Cosmological abundances of right-handed neutrinos