// Author: Moulik
// Date Created: 30 August 2020
// Filename: AT177D.cpp
#include <bits/stdc++.h>
using namespace std;
#ifdef _DEBUG
#define what_is(x) cerr << "DEBUG::BEGIN\n\tVariable name:\n\t\t" << #x << "\n\tdata:\n\t\t" << x << "\nDEBUG::END" << endl;
#else
#define what_is(x) ;
#endif

// CUSTOM FUNCTIONS

// Power using binary exponentation
long long power(long long base, int exponent){ 
    long long ans = 1;
    while(exponent > 0){ 
        if (exponent&1) 
            ans = (ans*base); 
        exponent >>= 1;
        base = base*base;
    }
    return ans; 
} 

// Power modulo p using binary exponentation
long long power(long long base, int exponent, int p){ 
    long long ans = 1;
    base = base%p;
    while(exponent > 0){ 
        if (exponent&1) 
            ans = (ans*base)%p; 
        exponent >>= 1;
        base = (base * base) % p; 
    } 
    return ans; 
}

// Return n^-1%p, given p is prime
int modInverse(int n, int p){
    return power(n,p-2,p);
}

// calculates factorial from 0 to n (inclusive)
void factorialCalc(vector<int> & factorial, int n){
    if(factorial.size()!=n+1){factorial.resize(n+1);}
    factorial[0]=1;
    factorial[1]=1;
    for(int i = 2; i <=n; i++){
        factorial[i] = factorial[i-1]*i;
    }
}

// calculates factorial mod p from 0 to n (inclusive) 
void factorialCalc(vector<int> & factorial, int n, int p){
    if(factorial.size()!=n+1){factorial.resize(n+1);}
    factorial[0]=1;
    factorial[1]=1;
    for(int i = 2; i <=n; i++){
        factorial[i] = (factorial[i-1]*1ll*i)%(p);
    }
}

// calculates nCr mod p, using fermats method, given p is prime.
unsigned long long nCr(unsigned long long n, int r, int p, vector<int> & fac){ 
    if (r == 0) 
        return 1; 
    return (1ll*fac[n] * modInverse(fac[r], p) % p * modInverse(fac[n - r], p) % p) % p; 
}

// Sorts array in the given order {key is 0 indexed}
template <typename T>
void keySort(vector<T> &arr, vector<int> &key){
    int n = arr.size();
    if(key.size()!=n){
        throw runtime_error("Size of data array not equals to size of key array");
    }
    vector<T> ans(n);
    int ar[n];
    for(int i = 0; i < n; i++){
        ar[key[i]]=i;
    }
    for(int i = 0; i < n; i++){
        ans[i] = arr[ar[i]];
    }
    arr = ans;
}

#define rprint(data) std::cout << data;return  
#define rprintln(data) std::cout << data << endl;return  

#define selfMin(x, y) x=std::min(x,y);
#define selfMax(x, y) x=std::max(x,y);

// OSTREAMS

template<typename T1, typename T2>
ostream & operator<<(ostream &os, const pair<T1,T2> p){
    os << '(' << p.first << ',' << p.second << ')';
    return os;
}

template<typename T>
ostream & operator<<(ostream &os, const vector<T> p){
    os << "{ ";
    for(auto i:p){
        os << i << ",";
    }
    os << "\b";
    os << "}";
    return os;
}

// ISTREAMS

template<typename T1, typename T2>
istream & operator >> (istream &in, pair<T1,T2> & p){
    in >> p.first >> p.second;
    return in;
}

void solve();

int main(){
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    solve();
    return 0;
}

class Graph{
    struct node{
        vector<int> adjList;
    };

    int n;
    vector<node> nodes;

    public:
    Graph(int n):
        n(n), nodes(n+1)
    {}

    void addEdge(int a, int b){
        nodes[a].adjList.push_back(b);
        nodes[b].adjList.push_back(a);
    }

    int getDisconnected(){
        int ans = 0;
        bool visited[n+1] = {};
        for(int i = 1; i <= n; i++){
            if(visited[i]){continue;}
            visited[i] = 1;
            stack<int> st;
            st.push(i);
            int tmp = 1;
            while(st.size()){
                auto tp = st.top();
                st.pop();
                for(auto i:nodes[tp].adjList){
                    if(visited[i]){continue;}
                    tmp++;
                    visited[i] = 1;
                    st.push(i);
                }
            }
            selfMax(ans,tmp);
        }
        return ans;
    }
};

void solve(){
    int n, m;
    cin >> n >> m;
    Graph g(n);
    for(int i = 0; i < m; i++){
        int a, b;
        cin >> a >> b;
        g.addEdge(a,b);
    }
    rprintln(g.getDisconnected());
}


Measured memory_bytes: 14980