The answer is: A. Dividing the mass of the sample by its molar mass.
For example, sample of ammonia:
m(NH₃) = 17.031 g; mass of ammonia.
M(NH₃) = Ar(N) + 3 · Ar(H) · g/mol.
M(NH₃) = 14.007 + 3 · 1.008 · g/mol.
M(NH₃) = 17.031 g/mol.
n(NH₃) = m(NH₃) ÷ M(NH₃).
n(NH₃) = 17.031 g ÷ 17.031 g/mol.
n(NH₃) = 1.0 mol; amount of ammonia.
The molar mass (M) is the mass of a given substance (in this example ammonia) divided by the amount of substance.