Suppose that there are in total of $n=|S|$ people in the department. For an arbitrary person, the number of friends he can have belong to the set $A=\{1,2,3,...,n-2,n-1\}$ (assume that every person can befriend with himself). Since there are $n$ people while $|A|=n-1$, at least 2 people have the same number of friends.
If we assume that no one can befriend with him/herself, then $A=\{0,1,2,...,n-1\}$. If we suppose that there's at least 1 person who has no friend, then $A'=\{0,1,2,...,n-2\}$ since there cannot be any people with $n-1$ friend now, making $|A'|=n-1$ anyway.