In the case of Cl, there are 7 valence electrons because the highest energy level, 3, has 7 total electrons. For Ca, there are two valence electrons. For Br, the highest level is 4, and there are 7 electrons, so the number of valence electrons for Br is 7.