Training 22 infantry, when I only have 20 residents? What’s going on?

So I only have 20 residents however I’m some how able to train 22 residents in one go? How does this work?