Hairytown Puzzle

The Puzzle:

The founders of Hairytown decreed years ago that:

1. No two people can have the same number of hairs
2. No one can have 999 hairs.
3. No one can have more, or the same, number of hairs as the population of the town

The town has now reached its maximum population - what is it?
Do you have the answer? Check against our solution!