And if you know the atomic number, which is the number of massive, positively charged nuclear particles, then you know the number of electrons. How do you know this? And if you know the atomic mass, then you know the number of neutrons.
Let's take #""^12C# as an example. Since it is a #C# isotope, I know #Z", the atomic number"=6#. How do I know this? If #Z=6#, then there are 6 electrons in the neutral atom. How do I know this? And if the atomic mass #=12#, then I know that there are #6# neutrons. It is worth getting your head round this, and ask for assistance if you are not getting it. You should never have to remember these details, because you should (and must) be provided with a Periodic Table in every examination in chemistry and physics you ever sit. You have to know how to use the Table though.