#include <bits/stdc++.h>
using namespace std;
int n;
int best;
vector<int> g[200001];
bool used[200001];
vector<int> comp;
bool ifprime(long long n) {
  if (n == 2 || n == 3) {
    return true;
  }
  for (long long i = 2; i <= sqrt(n); i++) {
    if (n % i == 0) {
      return false;
    }
  }
  return true;
}
long long gcd(long long a, long long b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
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_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
  while (t--) {
    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;
}
