Which number tells you the number of valence electrons?

The number of valence electrons is given by the GROUP number. So, group 3 has 3 valence electrons, and group 17 has 7 valence electrons.