Calculates the molar mass of a chemical using the chemical formula