Solution:
Consider a party with n people. Each person at the party has n - 1 possibilities for the number of people they have had sex with. There are n people at the party, so by the pigeonhole principle at least two people has had sex with the same number of people.
w^5 (which is what we wanted)
Further Explanation:
I will explain how we used the pigeonhole principle, which was stated as a hint in the first post. The n - 1 possibilities that each person has for his or her number are the holes. The people themselves are the pigeons. Since there are more pigeons than holes, at least two pigeons must be in the same hole (yes, every pigeon has to be in a hole, there's no such thing as "The number of people I've had sex with is undefined").
The pigeonhole principle is a useful principle that can make complex problems seem simple and elegant. When considering the pigeonhole principle, identify what the holes and pigeons are.