Unit problem regards to proton

In a textbook, we have an example:

The density of matter in the interstellar medium is of order one proton per $${\rm cm^3}$$, then the total mass of the interstellar medium is of order (The $$10^6$$ term accounts for the number cubic centimetres within one meter cubed). $$$$m=1\times V_\text{galaxy}\times m_\text{P}\times 10^6=3.3\times10^{40}{\rm kg}\approx 17 \cdot 10^9 M_{\odot} >$$$$

So I was wondering, should the unit of the equation be: $$\frac{{1}}{{\rm cm^3}}\times{\rm m^3}\times{\rm kg}$$?

And what exactly should be the unit of proton in the formula? Should it be unitless? Or $${\rm kg}$$? Thank you.

Source: Beech, M. (2019). Introducing the stars. Cham: Springer Nature Switzerland AG.

The unit of the equation is "kg" because the unit of $$10^6$$ is $$cm^3/m^3$$
The unit of the mass of the proton is in kg. The "1" is $$cm^{-3}$$ It represents 1 proton per cubic centimetre
It's probably easier to understand, if you write the formula as $$m = V_{galaxy} \cdot m_P \cdot n$$ with $$m$$ as mass, $$V_{galaxy}$$ as the volume of the galaxy im $$m^3$$, $$m_P$$ as proton mass in $$kg$$ and $$n$$ as the number density of the interstellar gas in $$m^{-3}$$. (When talking about density, it is important to be sure whether to talk about mass density, number density, column density or whatever... the describing noun often is left out because it is clear... yet sometimes isn't)
$$kg = m^3 \cdot kg \cdot m^{-3}$$