#include<iostream>
#include<vector>

using namespace std;

int dfs(vector<vector<int>> & g, vector<bool> & b, int idx)
{
  	b[idx] = false;
	int cnt = 1;
	for (int i = 0, len = g[idx].size(); i < len; i++)
		if (b[g[i]]) cnt += dfs(g, b, g[i]);
	return cnt;
}

int main(void)
{
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  
  int n, m;
  cin >> n >> m;
  
  vector<vector<int>> g;
  g.resize(n);
  
  for (int i = 0, j, k; i < m; i++)
  {
	cin >> j >> k;
	g[j-1].push_back(k-1);
	g[k-1].push_back(j-1);
  }
  
  vector<bool> b;
  b.resize(n);
  for (int i = 0; i < n; i++) b[i] = true; 

  int max = 0, cnt;
  for (int i = 0; i < n; i++)
	if (b[i])
	{
		cnt = dfs(g, b, i);
		max = max < cnt ? cnt : max;
	}

  cout << max;
  
  return 0;
}
