#include<bits/stdc++.h>
#define ll long long
#define mod 1000000007
using namespace std;
vector<ll> Graph[200005];
ll cnt;
bool vis[200005];
void dfs(ll cur)
{
	cnt++;
	vis[cur]=1;
	for(auto h:Graph[cur])
	{
		if(!vis[h])
		{
			dfs(h);
		}
	}
}
int main()
{
	ll n;
	cin>>n;
	ll m;
	cin>>m;
	while(m--)
	{
		ll x,y;
		cin>>x>>y;
		Graph[x].push_back(y);
		Graph[y].push_back(x);
	}
	ll ans=0;
	for(ll p=1;p<=n;p++)
	{
		if(!vis[p])
		{
			cnt=0;
			dfs(p);
			ans=max(ans,cnt);
		}
	}
	cout<<ans;
}
