It makes sense to also assign mass numbers to the sub-atomic constituents:

* A proton has mass number $1$.
* A neutron has mass number $1$.
* An electron has mass number $0$.

With this definition you consistently get the mass number
of an atom/ion by summing the mass numbers of its constituents.
For example: the Na atom and the Na$^+$ ion both have mass number $23$.