It's a very minor point, but I think I would write "will fail *if* the total number" instead of "will fail *as soon as* the total number"... To me, "as soon as" feels like the failure is expected to happen.