The number of moles in a sample is equal to the number of particles in the sample divided by the Avogadro's number:
n = NNA
N = number of particles in the substance
NA = Avogadro’s number (in mol-1)