import sys

input = sys.stdin.readline



n,m=list(map(int, input().split()))

es=[[] for _ in range(n)]

for i in range(m):

    a,b=list(map(int, input().split()))

    es[a-1].append(b-1)

    es[b-1].append(a-1)



ans=0

from collections import deque

used=[0 for _ in range(n)]

for i in range(n):

    if used[i]==0:

        d=deque([i])

        cnt=0

        while d:

            now=d.popleft()

            cnt+=1

            used[now]=1

            for e in es[now]:

                if used[e]==0:

                    used[e]=1

                    d.append(e)

        ans=max(cnt,ans)

print(ans)
import sys

input = sys.stdin.readline



n,m=list(map(int, input().split()))



class UnionFind(object):

    def __init__(self, n=1):

        self.par = [i for i in range(n)]

        self.rank = [0 for _ in range(n)]



    def find(self, x):

        if self.par[x] == x:

            return x

        else:

            self.par[x] = self.find(self.par[x])

            return self.par[x]



    def union(self, x, y):

        x = self.find(x)

        y = self.find(y)

        if x != y:

            if self.rank[x] < self.rank[y]:

                x, y = y, x

            if self.rank[x] == self.rank[y]:

                self.rank[x] += 1

            self.par[y] = x



    def is_same(self, x, y):

        return self.find(x) == self.find(y)



uf1=UnionFind(n)

ans=[]

for i in range(m):

    a,b=list(map(int, input().split())) #a,b:つながっている辺

    uf1.union(a-1,b-1)



for i in range(n):

    ans.append(uf1.find(i))

from collections import Counter

c=Counter(ans)

print((max(c.values())))
import sys

input = sys.stdin.readline
n, m = list(map(int, input().split()))
es = [[] for _ in range(n)]
for i in range(m):
    a, b = list(map(int, input().split()))
    es[a - 1].append(b - 1)
    es[b - 1].append(a - 1)
ans = 0
from collections import deque

used = [0 for _ in range(n)]
for i in range(n):
    if used[i] == 0:
        d = deque([i])
        cnt = 0
        while d:
            now = d.popleft()
            cnt += 1
            used[now] = 1
            for e in es[now]:
                if used[e] == 0:
                    used[e] = 1
                    d.append(e)
        ans = max(cnt, ans)
print(ans)

import sys

input = sys.stdin.readline
n, m = list(map(int, input().split()))


class UnionFind(object):
    def __init__(self, n=1):
        self.par = [i for i in range(n)]
        self.rank = [0 for _ in range(n)]

    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x != y:
            if self.rank[x] < self.rank[y]:
                x, y = y, x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
            self.par[y] = x

    def is_same(self, x, y):
        return self.find(x) == self.find(y)


uf1 = UnionFind(n)
ans = []
for i in range(m):
    a, b = list(map(int, input().split()))  # a,b:つながっている辺
    uf1.union(a - 1, b - 1)
for i in range(n):
    ans.append(uf1.find(i))
from collections import Counter

c = Counter(ans)
print((max(c.values())))

-es = [[] for _ in range(n)] + + +class UnionFind(object): +    def __init__(self, n=1): +        self.par = [i for i in range(n)] +        self.rank = [0 for _ in range(n)] + +    def find(self, x): +        if self.par[x] == x: +            return x +        else: +            self.par[x] = self.find(self.par[x]) +            return self.par[x] + +    def union(self, x, y): +        x = self.find(x) +        y = self.find(y) +        if x != y: +            if self.rank[x] < self.rank[y]: +                x, y = y, x +            if self.rank[x] == self.rank[y]: +                self.rank[x] += 1 +            self.par[y] = x + +    def is_same(self, x, y): +        return self.find(x) == self.find(y) + + +uf1 = UnionFind(n) +ans = [] -    a, b = list(map(int, input().split())) -    es[a - 1].append(b - 1) -    es[b - 1].append(a - 1) -ans = 0 -from collections import deque +    a, b = list(map(int, input().split()))  # a,b:つながっている辺 +    uf1.union(a - 1, b - 1) +for i in range(n): +    ans.append(uf1.find(i)) +from collections import Counter -used = [0 for _ in range(n)] -for i in range(n): -    if used[i] == 0: -        d = deque([i]) -        cnt = 0 -        while d: -            now = d.popleft() -            cnt += 1 -            used[now] = 1 -            for e in es[now]: -                if used[e] == 0: -                    used[e] = 1 -                    d.append(e) -        ans = max(cnt, ans) -print(ans) +c = Counter(ans) +print((max(c.values())))