Problem:
Score : 400 points

Problem Statement

There are N persons called Person 1 through Person N.

You are given M facts that "Person A_i and Person B_i are friends." The same fact may be given multiple times.

If X and Y are friends, and Y and Z are friends, then X and Z are also friends. There is no friendship that cannot be derived from the M given facts.

Takahashi the evil wants to divide the N persons into some number of groups so that every person has no friend in his/her group.

At least how many groups does he need to make?

Constraints

2 \leq N \leq 2\times 10^5

0 \leq M \leq 2\times 10^5

1\leq A_i,B_i\leq N

A_i \neq B_i

Input

Input is given from Standard Input in the following format:

N M
A_1 B_1
\vdots
A_M B_M

Output

Print the answer.

Sample Input 1

5 3
1 2
3 4
5 1

Sample Output 1

3

Dividing them into three groups such as \{1,3\}, \{2,4\}, and \{5\} achieves the goal.

Sample Input 2

4 10
1 2
2 1
1 2
2 1
1 2
1 3
1 4
2 3
2 4
3 4

Sample Output 2

4

Sample Input 3

10 4
3 1
4 1
5 9
2 6

Sample Output 3

3

Solution in C++ (GCC 9.2.1) (judge verdict: Time Limit Exceeded)

#include <algorithm>
#include <cmath>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
constexpr double PI = 3.141592653589793;
constexpr int INF = 1e9 + 10;
constexpr ll INFL = 1e18 + 10;

template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}

using namespace std;
//    cout << setprecision(20) << ans << "\n";

class DisjointSet {
 private:
  std::vector<int> parent;

 public:
  DisjointSet(int n) : parent(n, -1) {}

  bool unite(int x, int y) {
    x = root(x);
    y = root(y);

    if (x != y) {
      if (x > y) {
        std::swap(x, y);
      }
      parent[x] += parent[y];
      parent[y] = x;
    }

    return x != y;
  }

  bool same(int x, int y) { return root(x) == root(y); }

  int numOfGroups() {
    int c =
        count_if(parent.begin(), parent.end(), [](int x) { return x < -1; });
    return c;
  }

  vector<int> roots() {
    vector<int> ret;
    for (size_t i = 0; i < parent.size(); ++i) {
      if (parent[i] < 0) ret.emplace_back(i);
    }
    return ret;
  }

  vector<int> members(int x) {
    int xRoot = root(x);
    vector<int> ret;
    for (size_t i = 0; i < parent.size(); ++i) {
      if (root(i) == xRoot) ret.emplace_back(i);
    }
    return ret;
  }

  map<int, vector<int>> allGroups() {
    map<int, vector<int>> ret;
    auto allRoots = roots();
    for (auto e : allRoots) {
      ret.insert({e, members(e)});
    }
    return ret;
  }

  vector<int> get() { return parent; }

 private:
  int root(int x) { return parent[x] < 0 ? x : parent[x] = root(parent[x]); }
};

int main() {
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);

  int n, m;
  cin >> n >> m;
  DisjointSet uf(n);
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    uf.unite(a, b);
  }

  auto allMembers = uf.allGroups();
  //   for (auto e : allMembers) {
  //     cout << e.first << "\n";
  //     for (auto es : e.second) {
  //       cout << es << " ";
  //     }
  //     cout << "\n";
  //   }
  //   cout << "\n";
  int ans = -1;
  for (auto &e : allMembers) {
    int len = e.second.size();
    if (ans < len) {
      ans = e.second.size();
    }
  }
  cout << ans << "\n";
  return 0;
}