#include <bits/stdc++.h>
using namespace std;
int n;
int best;
vector<int> g[200001];
bool used[200001];
vector<int> comp;
void dfs(int v) {
  used[v] = true;
  comp.push_back(v);
  for (size_t i = 0; i < (int)g[v].size(); ++i) {
    int to = g[v][i];
    if (!used[to]) dfs(to);
  }
}
void find_comps() {
  for (int i = 0; i < n; ++i) used[i] = false;
  for (int i = 0; i < n; ++i)
    if (!used[i]) {
      comp.clear();
      dfs(i);
      int val = comp.size();
      best = max(best, val);
    }
}
int main() {
  ios::sync_with_stdio(0);
  int m;
  cin >> n >> m;
  for (int i = 1; i <= m; ++i) {
    int a, b;
    cin >> a >> b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  find_comps();
  cout << best;
  return 0;
}
