UVa 10608 - Friends

Summary
Find the biggest group of friends in a town.

Explanation
In this problem, we're trying to find the number of distinct sets, and can be solved by the Union Find algorithm.

Gotcha's
Don't read any more cases than are listed in the beginning of the input!

Input
2 3 2 1 2 2 3 10 12 1 2 3 1 3 4 5 4 3 5 4 6 5 2 2 1 7 10 1 2 9 10 8 9

Output
3 6