#P1842. Themore,thebetter

Themore,thebetter

LYHs teacher want some boys to help him with a project.Beaause the project is rather complex,

so the teacher want more boys to help him,the more,the better.Of course,there are certain 

requirements:<o:p></o:p>

The teacher select a big room to hold the boys.The boy who are not been chosen has to leave 

the room immediately.There are 1000 boys in the room numbered from 1 to 1000 at the beginning.

After the teachers selection,any two of them who are still in the room should be friends(

direct or indirect),or there is only one boy left.Given all the direct friend-pairs,you should 

output how many boys at most will help the teacher.<o:p></o:p>

Input

There are multiple test cases.
The first line of the input contains an integer N(0<=N<1000)represents the number of the direct friend-pairs.The following N lines each contains a pair of numbers A and B separated by a single space that suggests A and B are direct friends.(A≠B,1<=A,B<=1000)

Output

The output in one line contains one interger — the maximum number of boys that will help the teacher.

Sample Input

4
1 2
3 4
5 6
1 6
4
1 2
3 4
5 6
7 8

Sample Output

4
2

HINT

If A and B are friends(direct of indirect),B and C are friends(direct of indirect),then A and C are also friends(indirect).

Source