Calculation of grams produced