Take the atomic number (the number of electrons in the neutral atom) and distribute them over the subshells in Madelung order, filling each to its maximum (s 2, p 6, d 10, f 14). For chlorine (Z = 17): 1s2 2s2 2p6 3s2 3p5, or [Ne] 3s2 3p5, with 2, 8 and 7 electrons in shells K, L and M.