For a main group element, the valence electrons are defined as those electrons residing in the electronic shell of highest principal quantum number n. Thus, the number of valence electrons that it may have depends on the electron configuration in a simple way.