Calculating the number of molecules