Now for main group elements, we're going to say that the number of valence electrons that they possess equals their group number. For example, aluminum is in group 3A, so it has 3 valence electrons. These valence electrons are the outer shell electrons involved in forming chemical bonds. Besides the valence electrons, all the remaining electrons are called your inner core electrons. These are the electrons that are not valence electrons.
We're going to say here that your total number of electrons, which is connected to your atomic number for a neutral element, equals your valence electrons plus your inner core electrons. So here if we take a look at chlorine, chlorine has an atomic number of 17. When it is neutral, it has 17 protons, but more importantly 17 electrons. It is in group 7A, so that would mean out of the 17 total electrons, 7 of them are valence electrons. We can see here with this representation of the chlorine atom. We have here our 3rd shell, so n = 3, and in this 3rd shell we have our 7 valence electrons, 1,2,3,4,5,6,7. The remaining 10 electrons are in shells 2 and 1. They total up to a total of 10 electrons.
For chlorine, we'd see that we have our 7 valence electrons in the outer shell with all the remaining electrons serving as our inner core electrons.