How many valence electrons are in an atom of magnesium?