#include <bits/stdc++.h>
using namespace std;
vector<int> a[200000];
int c;
bool v[200000];
void dfs(int cur){
	v[cur] = true, c++;
	for (int e : a[cur]){
		if (!v[e]) dfs(e);
	}
}
int main(){
	int n, m, x, y, ans = 0;
	scanf("%d %d", &n, &m);
	for (int i = 0; i < m; i++){
		scanf("%d %d", &x, &y), x--, y--;
		a[x].emplace_back(y);
		a[y].emplace_back(x);
	}
	for (int i = 0; i < n; i++){
		c = 0;
		if (!v[i]) dfs(i);
		ans = max(ans, c);
	}
	printf("%d\n", ans);
}