How to calculate the number of molecules in a simulation box accurately?

I have a question about calculating the number of molecules in a simulation box. When I want to calculate the number of molecules for my new simulation box, I get confused by the numbers that I found and the numbers that I see in some papers. I use the step by calculating the moles of molecules (separately) and then finding the number of molecules. So I am wondering if I am missing something in calculating the correct number of molecules or not. Can you please help me with this and provide suggestions or resources?