Calculating molar mass and amounts of substances