The molar mass of monotonic Nitrogen is 14 g/mol. Since this is diatomic Nitrogen, double that to 28 g/mol.
Next, divide total mass by molar mass, 500 g / 28 g/mol, which givesĀ 17.8571 moles. A mole is defined as being 6.02210^23 molecules, so multiply moles by molecules/mol (Avogadro's number), and we finally end up with something like 1.075 10^25, give or take a few billion particles.