One transparent formula
Spendable budget is the larger of zero and budget minus reserve. Divide that amount by the equal price and round down. The remainder stays after all whole purchases; the tool also compares your target count with the available amount.