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

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

for _ in range(m):

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

    a,b=a-1,b-1

    adj[a].append(b)

    adj[b].append(a)



ans=0

vis=[0]*n

for i in range(n):

    if vis[i]:

        continue

    vis[i]=1

    k=0

    stk=[i]

    while stk:

        u=stk.pop()

        k+=1

        for v in adj[u]:

            if vis[v]:

                continue

            vis[v]=1

            stk.append(v)

    ans=max(ans,k)



print(ans)

import sys



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

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

for _ in range(m):

    a,b=list(map(int,next(sys.stdin).split()))

    a,b=a-1,b-1

    adj[a].append(b)

    adj[b].append(a)



ans=0

vis=[0]*n

for i in range(n):

    if vis[i]:

        continue

    vis[i]=1

    k=0

    stk=[i]

    while stk:

        u=stk.pop()

        k+=1

        for v in adj[u]:

            if vis[v]:

                continue

            vis[v]=1

            stk.append(v)

    ans=max(ans,k)



print(ans)

n, m = list(map(int, input().split()))
adj = [[] for _ in range(n)]
for _ in range(m):
    a, b = list(map(int, input().split()))
    a, b = a - 1, b - 1
    adj[a].append(b)
    adj[b].append(a)
ans = 0
vis = [0] * n
for i in range(n):
    if vis[i]:
        continue
    vis[i] = 1
    k = 0
    stk = [i]
    while stk:
        u = stk.pop()
        k += 1
        for v in adj[u]:
            if vis[v]:
                continue
            vis[v] = 1
            stk.append(v)
    ans = max(ans, k)
print(ans)

import sys

n, m = list(map(int, next(sys.stdin).split()))
adj = [[] for _ in range(n)]
for _ in range(m):
    a, b = list(map(int, next(sys.stdin).split()))
    a, b = a - 1, b - 1
    adj[a].append(b)
    adj[b].append(a)
ans = 0
vis = [0] * n
for i in range(n):
    if vis[i]:
        continue
    vis[i] = 1
    k = 0
    stk = [i]
    while stk:
        u = stk.pop()
        k += 1
        for v in adj[u]:
            if vis[v]:
                continue
            vis[v] = 1
            stk.append(v)
    ans = max(ans, k)
print(ans)

-n, m = list(map(int, input().split())) +import sys + +n, m = list(map(int, next(sys.stdin).split())) -    a, b = list(map(int, input().split())) +    a, b = list(map(int, next(sys.stdin).split()))