import sys

sys.setrecursionlimit(10 ** 9)



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

root = [-1] * n



def r(x):

    if root[x] < 0:

        return x

    else:

        root[x] = r(root[x])

        return root[x]

    



def unite(x, y):

    x = r(x)

    y = r(y)

    if x == y:

        return

    root[x] += root[y]

    root[y] = x

    



def size(x):

    x = r(x)

    return -root[x]





for i in range(m):

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

    x -= 1

    y -= 1

    unite(x,y)





max_size = 0

for i in range(n):

    max_size = max(size(i), max_size)





print(max_size)
import sys

sys.setrecursionlimit(10 ** 9)



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

root = [-1] * N



def parent(x):

    if root[x] < 0:

        return x

    root[x] = parent(root[x])

    return root[x]





def union(x, y):

    x_parent = parent(x)

    y_parent = parent(y)

    if x_parent == y_parent:

        return

    root[x_parent] += root[y_parent]

    root[y_parent] = x





def size(x):

    return -root[x]

    



for i in range(M):

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

    a -= 1

    b -= 1

    union(a, b)





max_size = 0

for i in range(N):

    max_size = max(size(i), max_size)



print(max_size)
import sys

sys.setrecursionlimit(10**9)
n, m = list(map(int, input().split()))
root = [-1] * n


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


def unite(x, y):
    x = r(x)
    y = r(y)
    if x == y:
        return
    root[x] += root[y]
    root[y] = x


def size(x):
    x = r(x)
    return -root[x]


for i in range(m):
    x, y = list(map(int, input().split()))
    x -= 1
    y -= 1
    unite(x, y)
max_size = 0
for i in range(n):
    max_size = max(size(i), max_size)
print(max_size)

import sys

sys.setrecursionlimit(10**9)
N, M = list(map(int, input().split()))
root = [-1] * N


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


def union(x, y):
    x_parent = parent(x)
    y_parent = parent(y)
    if x_parent == y_parent:
        return
    root[x_parent] += root[y_parent]
    root[y_parent] = x


def size(x):
    return -root[x]


for i in range(M):
    a, b = list(map(int, input().split()))
    a -= 1
    b -= 1
    union(a, b)
max_size = 0
for i in range(N):
    max_size = max(size(i), max_size)
print(max_size)

-n, m = list(map(int, input().split())) -root = [-1] * n +N, M = list(map(int, input().split())) +root = [-1] * N -def r(x): +def parent(x): -    else: -        root[x] = r(root[x]) -        return root[x] +    root[x] = parent(root[x]) +    return root[x] -def unite(x, y): -    x = r(x) -    y = r(y) -    if x == y: +def union(x, y): +    x_parent = parent(x) +    y_parent = parent(y) +    if x_parent == y_parent: -    root[x] += root[y] -    root[y] = x +    root[x_parent] += root[y_parent] +    root[y_parent] = x -    x = r(x) -for i in range(m): -    x, y = list(map(int, input().split())) -    x -= 1 -    y -= 1 -    unite(x, y) +for i in range(M): +    a, b = list(map(int, input().split())) +    a -= 1 +    b -= 1 +    union(a, b) -for i in range(n): +for i in range(N):