At a strange party, each person knew exactly $22$ others.

1. For any pair of people $X$ and $Y$ who knew one another, there was no other person at the party that they both knew.

2. For any pair of people $X$ and $Y$ who did not know each other, there were exactly six other people that they both knew.

How many people were at the party?

Let's think step by step and output the final answer within \boxed{}.
user