Scanf.scanf "%d %d" (fun n m ->
    let par = Array.init n (fun i -> i) in
    let size = Array.make n 1 in

    let rec root x =
        if par.(x) = x then x else
            let r = root par.(x) in
            let () = par.(x) <- r in
            r
    in

    let merge a b =
        if root a <> root b then (
            size.(par.(a)) <- size.(par.(a)) + size.(par.(b));
            par.(par.(b)) <- par.(a)
        )
    in
    for i = 1 to m do
        Scanf.scanf " %d %d" (fun a b -> merge (a - 1) (b - 1)
        )
    done;

    let rec loop i acc =
        if i = n then acc else loop (i + 1) (max acc size.(root i))
    in
    loop 0 0 |> Printf.printf "%d\n"
)
