Because the actual mass of a proton is 1.67x10^-27 and the same for a neutron so the mass is relative to the size of protons/neutrons. That's why electrons are not taken in to account when calculating the mass as their mass is 9.11x10^-31 so would make very little difference to the total mass.