Predicting Main-Group Ion Charges From Valence Electrons