The last energy level of the combined S and P blocks will give you the number of valence electrons. For example, For Nitrogen the configuration would be 1s2 2s2 2p3, the last energy level we used was 2, so you add up the electrons in the s and p block of the 2nd energy level and you come out with 5. Nitrogen has five valence electrons