#include<iostream> #include<cstdio> using namespace std; const int maxn = 10000004; int father[maxn],num[maxn]; int maxm; int Find(int x){ while(x != father[x]){ father[x] = father[father[x]]; x = father[x]; } return x; } void Union(int a,int b){ int ax = Find(a); int bx = Find(b); if(ax!=bx){ father[ax] = bx; num[bx] += num[ax]; //注意這是以bx爲根的,因此固然要讓num[bx]增長。 if(maxm < num[bx]){ maxm = num[bx]; } } } int main(){ int T; while(~scanf("%d",&T)){ if(T == 0){ cout<<1<<endl; continue; } for(int i = 1; i < 10000001; i++){ father[i] = i; num[i] = 1; } int a,b; maxm = -1; for(int i = 1; i <= T; i++){ scanf("%d%d",&a,&b); Union(a,b); } cout<<maxm<<endl; } return 0; }