#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <functional>
#include <list>
#include <numeric>
#include <math.h>
#include <cstdlib>
#include <queue>
#include <iterator>
#include <limits>
#include <string>
#include <sstream>
#include <iomanip>
#include <bitset>
#include <mutex>
#include <condition_variable>
#include <atomic>
#include <stack>
#include <memory>
#include <deque>
#include <string_view>
#include <random>
#include <chrono>
#include <cstring>

using namespace std;

static int my_speed_up = []() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); return 0; }();
using ll = long long; using ull = unsigned long long;
template<class T> using v = vector<T>;
template<class T> using vv = vector<vector<T>>;
template<class T> using vvv = vector<vector<vector<T>>>;
template<class T> using vvvv = vector<vector<vector<vector<T>>>>;
#define for_b(i, b) for (int i = 0; i < (b); ++i)
#define for_ab(i, a, b) for (int i = a; i < (b); ++i)
#define what_is(x) cout << #x << " = " << x << endl;
#define what_are(x,y) cout << #x << " = " << x << ", " << #y << " = " << y << endl;
#define pad(x) for_b(i, x) cout << "  ";
#define show_1d(___x) cout << #___x << " = "; for (auto& ___num : ___x) cout << ___num << ", "; cout << endl;
#define show_2d(___x) cout << #___x << endl; for (auto& ___row : ___x) { for (auto ___num : ___row) cout << ___num << ", "; cout << endl; }
#define show_3d(___x) cout << #___x << endl; for (auto& ___row : ___x) { for (auto& ___row2 : ___row) { for (auto ___num : ___row2) cout << ___num << ", "; cout << endl; }cout << endl; }

vv<int> d4 = {{1,0},{-1,0},{0,1},{0,-1}};
vv<int> d8 = {{1,0},{-1,0},{0,1},{0,-1},{1,1},{1,-1},{-1,1},{-1,-1}};
bool is_valid_pos(const vv<int>& tb, int x, int y) {
    return x >= 0 && x < tb.size() && y >= 0 && y < tb[0].size();
}



class Disjoint
{
private:
    struct Item
    {
        int group, size;
    };
    vector<Item> disjoint;

public:
    Disjoint(int n) : disjoint(n)
    {
        for (int i = 0 ; i < n ; ++i)
            disjoint[i] = {i, 1};
    }
    
    bool Union(int v1, int v2)
    {
        auto v1_item = Find(v1);
        auto v2_item = Find(v2);
        
        if (v1_item->group == v2_item->group)
            return true;
        if (v1_item->size < v2_item->size)
            swap(v1_item, v2_item);
            
        v2_item->group = v1_item->group;
        v1_item->size += v2_item->size;
        
        return false;
    }
    
    Item GetSet(int val)
    {
        return *Find(val);
    }
    
private:
    Item* Find(int val)
    {
        Item* item = &disjoint[val];
        while (item->group != val)
        {
            val = item->group;
            auto next_item = &disjoint[val];
            item->group = next_item->group;
            item = next_item;
        }
        return item;
    }
};


int main()
{
    int N, M;
    cin >> N >> M;
    
    Disjoint dsj(N);
    
    for_b(i,M)
    {
        int a, b;
        cin >> a >> b;
        dsj.Union(a-1, b-1);
    }
    
    int res = 0;
    for_b (i,N)
    {
        res = max(res, dsj.GetSet(i).size);
    }
    
    cout << res << endl;
    
    return 0;
}


Measured memory_bytes: 4780