#include using namespace std; struct unionfind{ vector a; vector p; unionfind(int N): a(N, 0), p(N, -1){ } int root(int x){ if (p[x] == -1){ return x; } else { p[x] = root(p[x]); return p[x]; } } void unite(int x, int y){ x = root(x); y = root(y); if (x != y){ p[y] = x; a[x] = max(a[x], a[y]); } a[x]++; } }; int main(){ int N, M; cin >> N >> M; vector u(M), v(M); for (int i = 0; i < M; i++){ cin >> u[i] >> v[i]; u[i]--; v[i]--; } unionfind UF(N); for (int i = M - 1; i >= 0; i--){ UF.unite(u[i], v[i]); } int ans = 0; for (int i = 0; i < N; i++){ ans = max(ans, UF.a[i]); } cout << ans << endl; }