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

d={i:set() for i in range(1,n+1)}

for i in range(m):

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

    d[a].add(b)

    d[b].add(a)



vis = set()

res = 0

for i in range(1,n+1):

    if i not in vis:

        stack=[i]

        ans=1

        vis.add(i)

        while stack:

            cur=stack.pop()

            for j in d[cur]:

                if j not in vis:

                    vis.add(j)

                    ans+=1

                    stack.append(j)

        res=max(res,ans)

print(res)

        

import sys

input = sys.stdin.readline



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

M=set(tuple(map(int,input().split())) for _ in range(m))

d={i:set() for i in range(1,n+1)}

for i,j in M:

    d[i].add(j)

    d[j].add(i)



vis=set()

res = 0

for i in range(1,n+1):

    if i not in vis:

        stack = [i]

        ans = 1

        vis.add(i)

        while stack:

            curr = stack.pop()

            for j in d[curr]:

                if j not in vis:

                    stack.append(j)

                    ans+=1

                    vis.add(j)

        res = max(ans,res)

print(res)





n, m = list(map(int, input().split()))
d = {i: set() for i in range(1, n + 1)}
for i in range(m):
    a, b = list(map(int, input().split()))
    d[a].add(b)
    d[b].add(a)
vis = set()
res = 0
for i in range(1, n + 1):
    if i not in vis:
        stack = [i]
        ans = 1
        vis.add(i)
        while stack:
            cur = stack.pop()
            for j in d[cur]:
                if j not in vis:
                    vis.add(j)
                    ans += 1
                    stack.append(j)
        res = max(res, ans)
print(res)

import sys

input = sys.stdin.readline
n, m = list(map(int, input().split()))
M = set(tuple(map(int, input().split())) for _ in range(m))
d = {i: set() for i in range(1, n + 1)}
for i, j in M:
    d[i].add(j)
    d[j].add(i)
vis = set()
res = 0
for i in range(1, n + 1):
    if i not in vis:
        stack = [i]
        ans = 1
        vis.add(i)
        while stack:
            curr = stack.pop()
            for j in d[curr]:
                if j not in vis:
                    stack.append(j)
                    ans += 1
                    vis.add(j)
        res = max(ans, res)
print(res)

+import sys + +input = sys.stdin.readline +M = set(tuple(map(int, input().split())) for _ in range(m)) -for i in range(m): -    a, b = list(map(int, input().split())) -    d[a].add(b) -    d[b].add(a) +for i, j in M: +    d[i].add(j) +    d[j].add(i) -            cur = stack.pop() -            for j in d[cur]: +            curr = stack.pop() +            for j in d[curr]: +                    stack.append(j) +                    ans += 1 -                    ans += 1 -                    stack.append(j) -        res = max(res, ans) +        res = max(ans, res)