Atomic mass is not simply the sum of the number of protons and neutrons in an atom. It is actually a weighted average of the masses of all the naturally occurring isotopes of an element, taking into account their relative abundances.
The atomic mass unit (amu) is a unit of mass used for expressing atomic and molecular weights. The standard atomic mass unit is defined as 1/12th the mass of an atom of carbon-12, which is assigned a mass of exactly 12 atomic mass units.
The mass of a proton is approximately 1.67 x 10^(-27) kilograms, which is roughly equivalent to 1 atomic mass unit (amu). However, this does not mean that the atomic mass unit represents the mass of protons only. It is simply a convenient unit of mass used in atomic and molecular calculations, where the mass of carbon-12 is used as the reference.
To calculate the atomic mass of an element, you would consider the masses and relative abundances of all the isotopes of that element. The atomic mass is determined experimentally and can be found on the periodic table. It is typically not a whole number because it accounts for the presence of different isotopes with varying numbers of neutrons.