Calculating grams of a product formed