At a party with 100 people, everyone is either a knight, who always tells the truth, or a knave, who always lies. Each person says they shook hands with a different number of knights at the party, from 0 to 99 . Each pair of people shook hands at most once, and everyone knows whether each other person is a knight or knave. Determine how many knights were at the party.
Call the person who said they shook hands with $i$ people person $i$ for each $i$ from 0 to 99 . Now, if person 99 is telling the truth, person 99 must have shaken hands with everyone else, and all the other people must be knights. But then person 0 would be lying, since they said they shook hands with no knights but must have shaken hands with person 99 . This is a contradiction, so person 99 must be a knave.

Similarly, if person 98 is a knight, person 98 must have shaken hands with people 0 to 97 , and they must all be knights. This again means person 0 would be lying, a contradiction, so person 98 is also a knave. Continuing in this manner, we find that person 97 is a knave, as is person 96 , and so on down to person 1 . Thus, only person 0 is telling the truth, so there were 99 knaves and one knight at the party.