# union find, bfs



import sys

from collections import deque

si = sys.stdin.readline





def main():

    [n, m] = [int(e) for e in si().split()]

    if not m:

        print((1))

        return



    visited = [False]*(n+1)

    fm = [set() for _ in range(n+1)]

    mx, comp = 0, 0



    while m:

        m -= 1

        [a, b] = [int(e) for e in si().split()]

        fm[a].add(b)

        fm[b].add(a)



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

        if visited[i]:

            continue

        visited[i] = True

        comp += 1

        q = deque()

        q.append(i)

        cnt = 1

        while q:

            curr = q.popleft()

            for e in fm[curr]:

                if not visited[e]:

                    visited[e] = True

                    q.append(e)

                    cnt += 1

        mx = max(mx, cnt)

    print(mx)



if __name__ == '__main__':

    main()

# union find, bfs



import sys

from collections import deque

si = sys.stdin.readline





def main():

    [n, m] = [int(e) for e in si().split()]

    if not m:

        print((1))

        return



    visited = [False]*(n+1)

    fm = [set() for _ in range(n+1)]

    mx = 0



    while m:

        m -= 1

        [a, b] = [int(e) for e in si().split()]

        fm[a].add(b)

        fm[b].add(a)



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

        if visited[i]:

            continue

        visited[i] = True

        q = deque()

        q.append(i)

        cnt = 1

        while q:

            curr = q.popleft()

            for e in fm[curr]:

                if not visited[e]:

                    visited[e] = True

                    q.append(e)

                    cnt += 1

        mx = max(mx, cnt)

    print(mx)



if __name__ == '__main__':

    main()

# union find, bfs
import sys
from collections import deque

si = sys.stdin.readline


def main():
    [n, m] = [int(e) for e in si().split()]
    if not m:
        print((1))
        return
    visited = [False] * (n + 1)
    fm = [set() for _ in range(n + 1)]
    mx, comp = 0, 0
    while m:
        m -= 1
        [a, b] = [int(e) for e in si().split()]
        fm[a].add(b)
        fm[b].add(a)
    for i in range(1, n + 1):
        if visited[i]:
            continue
        visited[i] = True
        comp += 1
        q = deque()
        q.append(i)
        cnt = 1
        while q:
            curr = q.popleft()
            for e in fm[curr]:
                if not visited[e]:
                    visited[e] = True
                    q.append(e)
                    cnt += 1
        mx = max(mx, cnt)
    print(mx)


if __name__ == "__main__":
    main()

# union find, bfs
import sys
from collections import deque

si = sys.stdin.readline


def main():
    [n, m] = [int(e) for e in si().split()]
    if not m:
        print((1))
        return
    visited = [False] * (n + 1)
    fm = [set() for _ in range(n + 1)]
    mx = 0
    while m:
        m -= 1
        [a, b] = [int(e) for e in si().split()]
        fm[a].add(b)
        fm[b].add(a)
    for i in range(1, n + 1):
        if visited[i]:
            continue
        visited[i] = True
        q = deque()
        q.append(i)
        cnt = 1
        while q:
            curr = q.popleft()
            for e in fm[curr]:
                if not visited[e]:
                    visited[e] = True
                    q.append(e)
                    cnt += 1
        mx = max(mx, cnt)
    print(mx)


if __name__ == "__main__":
    main()

-    mx, comp = 0, 0 +    mx = 0 -        comp += 1