Calculating mass of a compound in a solution