The lowest oxidation number of an atom in a compound \( \mathrm{A_2B} \) is \( -2 \). The number of electrons in its valence shell is _______.