from collections import defaultdict,deque

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



d = defaultdict(list)



if m==0:

    print((1))

    exit()



visited = [-1] + [False]*n

for i in range(m):

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

    d[a].append(b)

    d[b].append(a)

maxi = 1

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

    if visited[i]:

        continue

    cnt = 0

    que = deque([i])

    while que:

        v = que.pop()

        if not visited[v]:

            visited[v] = True

            cnt += 1

        for j in d[v]:

            if not visited[j]:

                que.append(j)

    maxi = max(maxi,cnt)

print(maxi)
class UnionFind:

    def __init__(self, n):

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

        self.rank = [0] * (n+1)

        self.size = [1] * (n+1)



    # 検索

    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:

            return

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

            self.par[x] = y

            self.size[y] += self.size[x]

        else:

            self.par[y] = x

            self.size[x] += self.size[y]

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

                self.rank[x] += 1



    # 同じ集合に属するか判定

    def same_check(self, x, y):

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

    



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

uf = UnionFind(n)

for i in range(m):

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

    uf.union(a,b)

print((max(uf.size)))
from collections import defaultdict, deque

n, m = list(map(int, input().split()))
d = defaultdict(list)
if m == 0:
    print((1))
    exit()
visited = [-1] + [False] * n
for i in range(m):
    a, b = list(map(int, input().split()))
    d[a].append(b)
    d[b].append(a)
maxi = 1
for i in range(1, n + 1):
    if visited[i]:
        continue
    cnt = 0
    que = deque([i])
    while que:
        v = que.pop()
        if not visited[v]:
            visited[v] = True
            cnt += 1
        for j in d[v]:
            if not visited[j]:
                que.append(j)
    maxi = max(maxi, cnt)
print(maxi)

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

    # 検索
    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:
            return
        if self.rank[x] < self.rank[y]:
            self.par[x] = y
            self.size[y] += self.size[x]
        else:
            self.par[y] = x
            self.size[x] += self.size[y]
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    # 同じ集合に属するか判定
    def same_check(self, x, y):
        return self.find(x) == self.find(y)


n, m = list(map(int, input().split()))
uf = UnionFind(n)
for i in range(m):
    a, b = list(map(int, input().split()))
    uf.union(a, b)
print((max(uf.size)))

-from collections import defaultdict, deque +class UnionFind: +    def __init__(self, n): +        self.par = [i for i in range(n + 1)] +        self.rank = [0] * (n + 1) +        self.size = [1] * (n + 1) + +    # 検索 +    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: +            return +        if self.rank[x] < self.rank[y]: +            self.par[x] = y +            self.size[y] += self.size[x] +        else: +            self.par[y] = x +            self.size[x] += self.size[y] +            if self.rank[x] == self.rank[y]: +                self.rank[x] += 1 + +    # 同じ集合に属するか判定 +    def same_check(self, x, y): +        return self.find(x) == self.find(y) + -d = defaultdict(list) -if m == 0: -    print((1)) -    exit() -visited = [-1] + [False] * n +uf = UnionFind(n) -    d[a].append(b) -    d[b].append(a) -maxi = 1 -for i in range(1, n + 1): -    if visited[i]: -        continue -    cnt = 0 -    que = deque([i]) -    while que: -        v = que.pop() -        if not visited[v]: -            visited[v] = True -            cnt += 1 -        for j in d[v]: -            if not visited[j]: -                que.append(j) -    maxi = max(maxi, cnt) -print(maxi) +    uf.union(a, b) +print((max(uf.size)))