Hello!
The answer is: The mass number of an atom is obtained by totaling the number of protons and neutrons.
Why?
The atomic mass can be calculated by the sum of the protons and neutron mass of an element.
We should not confuse the atomic mass with the relative atomic mass since the relative atomic mass of an element is the average mass of its particles/atoms compared to 1/12th the mass of a carbon-12 particle/atom.
Have a nice day!