Calculation of product quantity