import queue

N, M = list(map(int, input().split()))

l = [[] for i in range(N)]

for i in range(M):

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

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

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

c = [0] * N 

ans = 1

q = queue.Queue()

for j in range(N):

        q.put(l[j])

        u = 0 

        while not q.empty():

                temp = q.get()

                for k in temp:

                        if c[k]:

                                continue

                        c[k] = 1 

                        u += 1

                        q.put(l[k])

        ans = max(ans, u)

print(ans) 
N, M = list(map(int, input().split()))

r = [-1] * (N + 1)



def root(x):

        if r[x] < 0:

                return x

        return root(r[x])



for i in range(M):

        x, y = list(map(int, input().split()))

        x = root(x)

        y = root(y)

        if x == y:

                continue

        if r[x] > r[y]:

                x, y = y, x

        r[x] += r[y]

        r[y] = x 



print((-min(r)))
import queue

N, M = list(map(int, input().split()))
l = [[] for i in range(N)]
for i in range(M):
    a, b = list(map(int, input().split()))
    l[a - 1].append(b - 1)
    l[b - 1].append(a - 1)
c = [0] * N
ans = 1
q = queue.Queue()
for j in range(N):
    q.put(l[j])
    u = 0
    while not q.empty():
        temp = q.get()
        for k in temp:
            if c[k]:
                continue
            c[k] = 1
            u += 1
            q.put(l[k])
    ans = max(ans, u)
print(ans)

N, M = list(map(int, input().split()))
r = [-1] * (N + 1)


def root(x):
    if r[x] < 0:
        return x
    return root(r[x])


for i in range(M):
    x, y = list(map(int, input().split()))
    x = root(x)
    y = root(y)
    if x == y:
        continue
    if r[x] > r[y]:
        x, y = y, x
    r[x] += r[y]
    r[y] = x
print((-min(r)))

-import queue +N, M = list(map(int, input().split())) +r = [-1] * (N + 1) -N, M = list(map(int, input().split())) -l = [[] for i in range(N)] + +def root(x): +    if r[x] < 0: +        return x +    return root(r[x]) + + -    a, b = list(map(int, input().split())) -    l[a - 1].append(b - 1) -    l[b - 1].append(a - 1) -c = [0] * N -ans = 1 -q = queue.Queue() -for j in range(N): -    q.put(l[j]) -    u = 0 -    while not q.empty(): -        temp = q.get() -        for k in temp: -            if c[k]: -                continue -            c[k] = 1 -            u += 1 -            q.put(l[k]) -    ans = max(ans, u) -print(ans) +    x, y = list(map(int, input().split())) +    x = root(x) +    y = root(y) +    if x == y: +        continue +    if r[x] > r[y]: +        x, y = y, x +    r[x] += r[y] +    r[y] = x +print((-min(r)))