how many valenceelectrons does rare earth metals have