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



friends = [set() for _ in range(N)]

for _ in range(M):

    a, b = [int(x)-1 for x in input().split()]

    friends[a].add(b)

    friends[b].add(a)

# print(friends)



visited = [0]*N #グループを作って合ったら

ans = 0

for i in range(N):

    if visited[i]:

        continue

    tmp = list(friends[i])

    ans_tmp = 1

    visited[i] = 1

    while tmp:

        t = tmp.pop()

        if not visited[t]:

            visited[t] = 1

            ans_tmp += 1

            for j in friends[t]:

                tmp.append(j)



    ans = max(ans, ans_tmp)

print(ans)

def main():

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



    friends = [set() for _ in range(N)]

    for _ in range(M):

        a, b = [int(x)-1 for x in input().split()]

        friends[a].add(b)

        friends[b].add(a)

    # print(friends)



    visited = [0]*N #グループを作って合ったら

    ans = 0

    for i in range(N):

        if visited[i]:

            continue

        tmp = list(friends[i])

        ans_tmp = 1

        visited[i] = 1

        while tmp:

            t = tmp.pop()

            if not visited[t]:

                visited[t] = 1

                ans_tmp += 1

                for j in friends[t]:

                    tmp.append(j)



        ans = max(ans, ans_tmp)

    print(ans)



if __name__ == '__main__':

    main()
N, M = list(map(int, input().split()))
friends = [set() for _ in range(N)]
for _ in range(M):
    a, b = [int(x) - 1 for x in input().split()]
    friends[a].add(b)
    friends[b].add(a)
# print(friends)
visited = [0] * N  # グループを作って合ったら
ans = 0
for i in range(N):
    if visited[i]:
        continue
    tmp = list(friends[i])
    ans_tmp = 1
    visited[i] = 1
    while tmp:
        t = tmp.pop()
        if not visited[t]:
            visited[t] = 1
            ans_tmp += 1
            for j in friends[t]:
                tmp.append(j)
    ans = max(ans, ans_tmp)
print(ans)

def main():
    N, M = list(map(int, input().split()))
    friends = [set() for _ in range(N)]
    for _ in range(M):
        a, b = [int(x) - 1 for x in input().split()]
        friends[a].add(b)
        friends[b].add(a)
    # print(friends)
    visited = [0] * N  # グループを作って合ったら
    ans = 0
    for i in range(N):
        if visited[i]:
            continue
        tmp = list(friends[i])
        ans_tmp = 1
        visited[i] = 1
        while tmp:
            t = tmp.pop()
            if not visited[t]:
                visited[t] = 1
                ans_tmp += 1
                for j in friends[t]:
                    tmp.append(j)
        ans = max(ans, ans_tmp)
    print(ans)


if __name__ == "__main__":
    main()

-N, M = list(map(int, input().split())) -friends = [set() for _ in range(N)] -for _ in range(M): -    a, b = [int(x) - 1 for x in input().split()] -    friends[a].add(b) -    friends[b].add(a) -# print(friends) -visited = [0] * N  # グループを作って合ったら -ans = 0 -for i in range(N): -    if visited[i]: -        continue -    tmp = list(friends[i]) -    ans_tmp = 1 -    visited[i] = 1 -    while tmp: -        t = tmp.pop() -        if not visited[t]: -            visited[t] = 1 -            ans_tmp += 1 -            for j in friends[t]: -                tmp.append(j) -    ans = max(ans, ans_tmp) -print(ans) +def main(): +    N, M = list(map(int, input().split())) +    friends = [set() for _ in range(N)] +    for _ in range(M): +        a, b = [int(x) - 1 for x in input().split()] +        friends[a].add(b) +        friends[b].add(a) +    # print(friends) +    visited = [0] * N  # グループを作って合ったら +    ans = 0 +    for i in range(N): +        if visited[i]: +            continue +        tmp = list(friends[i]) +        ans_tmp = 1 +        visited[i] = 1 +        while tmp: +            t = tmp.pop() +            if not visited[t]: +                visited[t] = 1 +                ans_tmp += 1 +                for j in friends[t]: +                    tmp.append(j) +        ans = max(ans, ans_tmp) +    print(ans) + + +if __name__ == "__main__": +    main()