#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <cmath>
#include <limits>
#define ALL(x) (x).begin(),(x).end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define int_INF 2147483647
#define pint_INF 2000000000
#define ll_INF 	9223372036854775807
#define MOD 1000000007
#define vi vector<int>
#define vvi vector<vector<int>>
#define vvll vector<vector<long long>>
#define vvc vector<vector<char>>
#define vll vector<long long>
#define pii pair<int,int>
#define vpii vector<pair<int,int>>
#define sysp system("PAUSE")
#define pno cout << "no" << endl
#define pyes cout << "yes" << endl
#define pYes cout << "Yes" << endl
#define pNo cout << "No" << endl
#define pNO cout << "NO" << endl
#define pYES cout << "YES" << endl
#define endl "\n"
#define pi 3.14159265358979
using namespace std;
using ll = long long;


class UnionFind {
public:
    vector<vector<int>> Graph;// {ID,Number,ParentID,Height}
    vector<bool> isClosed;
    vector<int> sizeof_subset;
public:
    void push(int x) {
        int i = Graph.size();
        Graph.push_back({ i,x,i,1 });
        isClosed.push_back(false);
        sizeof_subset.push_back(0);
    }
    void unite(int x, int y) {
        if (root(x) == root(y)) {
            isClosed[root(x)] = true;
            isClosed[root(y)] = true;
        }
        int hx = Graph[root(x)][3];
        int hy = Graph[root(y)][3];
        if (hx < hy) {
            Graph[root(x)][2] = root(y);
            flatten(x, root(y));
        }
        else if (hx == hy) {
            Graph[root(y)][2] = root(x);
            Graph[root(x)][3]++;
            flatten(y, root(x));
        }
        else {
            Graph[root(y)][2] = root(x);
            flatten(y, root(x));
        }
    }
    bool isSame(int x, int y) {
        return root(x) == root(y);
    }

    void flatten(int x, int rootid) {
        int parentid = Graph[x][0];
        while (Graph[parentid][0] != Graph[parentid][2]) {
            Graph[parentid][2] = rootid;
            int next = Graph[parentid][2];
            parentid = next;
        }
    }
    int root(int x) {
        int parentid = Graph[x][0];
        while (Graph[parentid][0] != Graph[parentid][2]) {
            int next = Graph[parentid][2];
            parentid = next;
        }

        return parentid;
    }

    int max_subset() {
        for (int i = 0; i < Graph.size(); i++) {
            int root_ind = root(i);
            sizeof_subset[root_ind]++;
        }
        auto iter = max_element(ALL(sizeof_subset));
        return *iter;
    }
};

int main() {
    int n, m; cin >> n >> m;
    UnionFind uf;
    for (int i = 0; i < n; i++) {
        uf.push(i);
    }

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

Measured memory_bytes: 14956