// Slower C++ solution:


#include<bits/stdc++.h>

using namespace std;

#include <ext/pb_ds/assoc_container.hpp>

#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;

#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

#define ll long long

#define si(n) scanf("%d",&n);

#define PI acos(-1.0)

#define sl(n) scanf("%lld",&n);

#define sf(n) scanf("%lf",&n);

#define ss(n) scanf("%s",n);

#define for0(i,n) for(ll i=0;i<n;i++)

#define for1(i,n) for(ll i=1;i<=n;i++)

#define forc(i,j,n) for(ll i=j;i<n;i++)

#define pb push_back

#define sor(n) sort(n.begin(),n.end())

#define sorcmp(n) sort(n.begin(),n.end(),cmp)

#define rev(n) reverse(n.begin(),n.end())

#define pi(x)  printf("%d",x);

#define pl(x)  printf("%lld",x);

#define pf(x)  printf("%.10lf",x);

#define ps(x)  printf("%s",x);

#define en() printf("\n");

#define random_shuffle(r...)random_shuffle(r,[](int _){return rand()%_;})

#define SQR(a) (a)*(a)

#define sp(x) fixed<<setprecision(x)

#define mod 1000000007

#define endl '\n'

#define pii pair<int,int>

#define pll pair<ll,ll>

#define bug cout<<"Here"<<endl

void fastio(){ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);}

template <typename T> T POW(T B,T P){ if(P==0) return 1; if(P&1) return B*POW(B,P-1);  else return SQR(POW(B,P/2));}

ll powmod(ll a, ll b){ll ans = 1;while(b){if(b&1) ans = ans*a%mod;a = a*a%mod;b >>= 1;}return ans;}



#define mxn 200005

vector<int>g[mxn];

int vis[mxn];



int bfs(int x)

{

    vis[x]++;

    queue<int>q;

    q.push(x);

    int cnt=1;

    while(!q.empty())

    {

        int v=q.front();

        q.pop();



        for(auto u:g[v])

        {

            if(vis[u]) continue;

            vis[u]++;

            cnt++;

            q.push(u);

        }

    }



    return cnt;

}





int main()

{





    int n,m;

    cin>>n>>m;



    while(m--)

    {

        int a,b;

        cin>>a>>b;

        g[a].pb(b);

        g[b].pb(a);

    }

    int mx=-1;

    for(int i=1;i<=n;i++)

    {

        if(vis[i]) continue;

        mx=max(mx,bfs(i));

    }



    cout<<mx<<endl;











	return 0;

}




// Faster C++ solution for the same problem (measured speedup: 6.3917615761315x):
#include <bits/stdc++.h>

#define REP(i, a, b) for(int i = (int)a; i < (int)b; i++)

#define fastio ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)

#define pb push_back

#define mp make_pair

#define st first

#define nd second

#define vi vector<int>

#define ii pair<int, int>

#define ll long long int

#define MAX 200010

#define MOD 1000000007

#define oo 0x7fffffff

#define endl '\n'

using namespace std;



int N, M;



class UFDS{

private: vi p, size;

public:

	UFDS(int N){

		size.assign(N+1, 1);p.assign(N+1, 0);

		iota(p.begin(), p.end(), 0);

	}

	int find_set(int i) {

		return (p[i] == i) ? i : find_set(p[i]);

	}

	bool same_set(int i, int j) { 

		return find_set(i) == find_set(j);

	}

	void union_set(int i, int j) {

		if(same_set(i, j))

			return;



		int x = find_set(i), y = find_set(j);

		

		if(size[x] < size[y])

			swap(x, y);

		p[y] = x;

		size[x] += size[y];

	}

	int get_size(int i){

		return size[find_set(i)];

	}

};



int main()

{

   

	fastio;

	// freopen("input.txt", "r", stdin);

	// freopen("output.txt", "w", stdout);



	cin >> N >> M;

	UFDS udfs(N);

	REP(i, 0, M){

		int a, b;

		cin >> a >> b;

		udfs.union_set(a, b);

	}

	int ans = 0;

	REP(i, 1, N+1){

		// cout << udfs.find_set(i) << endl;

		ans = max(ans, udfs.get_size(i));

	}

	cout << ans << endl;



    return 0;

}