A semiempirical model for calculation of the energies of states of multielectron ions