Optimization of a product batch quantity