We consider a single-stage single-product production system. Produced units may be non-defective, reworkable defective, or non-reworkable defective. The system switches between production and rework. After producing a fixed number (N) of units, all reworkable defective units are reworked. Reworkable defectives are perishable or can become technologically obsolete. We assume that the rework time and the rework cost increase linearly with the time that a unit is held in stock. Therefore, N should not be too large. On the other hand, N should not be too small either, since there are set-up times and costs associated with switching between production and rework. For a given N, we derive an explicit expression for the average profit (sales revenue minus costs). Using this expression, the optimal value for N can be determined numerically. Moreover, it is easy to perform a sensitivity analysis, as we illustrate.