The number of moles in a sample is equal to the mass of the sample divided by the molar mass of the substance:
n = mM
m = mass of the substance (in g)
M = molar mass of the substance (in g.mol-1)