Determining quantity and profitability