/*
**   Contest : AtCoder Beginner Contest 177
**   Problem : D - Friends
**
**    Author : Dhiraj Govindvira
**      Date : 29-Aug-2020 ~ Saturday
**      Time : 07:38:23 PM
*/

#if __has_include("D:/dhiraj/Programming/debug.h")
    #include "D:/dhiraj/Programming/debug.h"
#else
    #include <bits/stdc++.h>
    using namespace std;
    #define d(...) 11
    #define cerr if(0) cerr
#endif

// Macro --------------------------------------------------------------------

#define ll                  long long int
#define FOR(i, a, b, s)     for(ll i = (a); ((s) > 0 ? i < (b) : i > (b)); i += (s))
#define FOR1(b)             FOR(i, 0, b, 1)
#define FOR2(i, b)          FOR(i, 0, b, 1)
#define FOR3(i, a, b)       FOR(i, a, b, (a) <= (b) ? 1 :-1)
#define FOR4(i, a, b, s)    FOR(i, a, b, s)
#define GET5(a, b, c, d, e, ...) e
#define FORC(...)           GET5(__VA_ARGS__, FOR4, FOR3, FOR2, FOR1)
#define loop(...)           FORC(__VA_ARGS__)(__VA_ARGS__)
#define all(x)              x.begin(), x.end()
#define rall(x)             x.rbegin(), x.rend()
#define endl                '\n'

// Template -----------------------------------------------------------------

// multiple input
template <typename... T> 
inline void inp(T&... args) {
    ((cin>>args), ...);
}
// scan vector
template <typename T> 
inline istream& operator >>(istream &in, vector<T> &a) {
    for(auto &x : a) in >> x;
    return in;
}
// scan pair
template <typename T, typename U> 
inline istream& operator >>(istream &in, pair<T, U> &a) {
    in >> a.first >> a.second; 
    return in;
}

// Solve --------------------------------------------------------------------

struct DSU
{
    ll cc, n;
    vector<ll> parent, size;
    set<pair<ll,ll>> sp;

    DSU(ll N = 1e5)
    {
        cc = n = N;
        parent.resize(n + 5);
        size.resize(n + 5);

        for(ll i = 1; i <= n; i++)
        {
            size[i] = 1;
            parent[i] = i;
            sp.emplace(1, i);
        }
    }

    ll Find(ll x)
    {
        if(parent[x] != x) {
            parent[x] = Find(parent[x]);
        }
        return parent[x];
    }

    bool Union(ll x, ll y)
    {
        assert(x >= 1 and x <= n and y >= 1 and y <= n);
        
        ll xroot = Find(x);
        ll yroot = Find(y);

        if(xroot != yroot)
        {
            cc--;
            ll s1 = size[xroot];
            ll s2 = size[yroot];

            sp.erase({s1, xroot});
            sp.erase({s2, yroot});

            if(s1 > s2) swap(xroot, yroot);
            parent[xroot] = yroot;
            size[yroot] = s1 + s2;
            
            sp.emplace(s1 + s2, yroot);
        }
        return xroot != yroot;
    }

    ll sz(ll x) {
        return size[Find(x)];
    }

    friend void deprint(DSU &g)
    {
        cerr << "N = " << g.n << ", cc = " << g.cc << "\n";
        map<ll, vector<ll>> pc;
        for(ll i = 1; i <= g.n; i++) {
            pc[g.Find(i)].push_back(i);
        }
        d(pc);
        d(g.sp);
    }
};

void solve(int &T)
{
    ll n, m;
    cin >> n >> m;

    DSU g(n);
    while(m--)
    {
        ll x, y;
        cin >> x >> y;
        g.Union(x, y);
    }
    cout << (*g.sp.rbegin()).first << endl;
}

// Main ---------------------------------------------------------------------

int main()
{
    #ifdef Dhiraj
        freopen("D:/dhiraj/Programming/i1.txt", "r", stdin);
        freopen("D:/dhiraj/Programming/o1.txt", "w", stdout);
        // freopen("D:/dhiraj/Programming/e1.txt", "w", stderr);
    #endif

    ios::sync_with_stdio(false);
    cin.tie(0);

    int t = 1;
    for(int i = 1; i <= t; i++) {
        cerr << "Case #" << i << "\n";
        solve(i);
    }
    return 0;
}

Measured memory_bytes: 18752