In the town of Naogaon, the following facts are true:
- No two inhabitants have exactly the same number of hairs.
- No inhabitant has exactly 518 hairs.
- There are more inhabitants than there are hairs on the head of any one inhabitant.
What is the largest possible number of inhabitants of Naogaon?