Problem:
Score : 400 points

Problem Statement

There are N persons called Person 1 through Person N.

You are given M facts that "Person A_i and Person B_i are friends." The same fact may be given multiple times.

If X and Y are friends, and Y and Z are friends, then X and Z are also friends. There is no friendship that cannot be derived from the M given facts.

Takahashi the evil wants to divide the N persons into some number of groups so that every person has no friend in his/her group.

At least how many groups does he need to make?

Constraints

2 \leq N \leq 2\times 10^5

0 \leq M \leq 2\times 10^5

1\leq A_i,B_i\leq N

A_i \neq B_i

Input

Input is given from Standard Input in the following format:

N M
A_1 B_1
\vdots
A_M B_M

Output

Print the answer.

Sample Input 1

5 3
1 2
3 4
5 1

Sample Output 1

3

Dividing them into three groups such as \{1,3\}, \{2,4\}, and \{5\} achieves the goal.

Sample Input 2

4 10
1 2
2 1
1 2
2 1
1 2
1 3
1 4
2 3
2 4
3 4

Sample Output 2

4

Sample Input 3

10 4
3 1
4 1
5 9
2 6

Sample Output 3

3

Solution in Rust (1.42.0) (judge verdict: Wrong Answer)

#![allow(unused_variables, dead_code, clippy::many_single_char_names, unused_imports, unused_macros)]
use std::{
    collections::{HashSet, HashMap, VecDeque},
    io::{stdin, stdout, StdinLock, StdoutLock, BufReader, BufWriter, prelude::*},
    str::FromStr,
};

struct Reader<'a> {
    stdin: BufReader<StdinLock<'a>>
}

trait Integers {
    fn read_int<T: FromStr>(&mut self, cap: usize) -> T;
}

impl<'a> Reader<'a> {
    fn new(stdin: BufReader<StdinLock<'a/*'*/>>) -> Self {
        Self {stdin}
    }

    fn read_str(&mut self, cap: usize) -> String {
        let mut s = String::with_capacity(cap);
        self.stdin.read_line(&mut s).unwrap();

        if s.ends_with('\n') {
            s.pop();
            if s.ends_with('\r') {
                s.pop();
            }
        }
        s
    }

    fn read_vec_u8(&mut self, cap: usize) -> Vec<u8> {
        let mut v = Vec::with_capacity(cap);
        self.stdin.read_exact(&mut v[..]).unwrap();

        v
    }
}

impl<'a> Integers for Reader<'a> {
    fn read_int<T: FromStr>(&mut self, cap: usize) -> T {
        match self.read_str(cap).parse::<T>() {
            Ok(n) => n,
            _ => panic!()
        }
    }
}


const M: usize = 1_000_000;

fn main() {
    let stdin = stdin();
    let stdout = stdout();
    
    solve(&mut Reader::new(BufReader::with_capacity(M, stdin.lock())), &mut BufWriter::with_capacity(M, stdout.lock()));
}

#[allow(clippy::needless_range_loop)]
fn solve(r: &mut Reader, w: &mut BufWriter<StdoutLock>) {
    let t = r.read_str(13);
    let mut it = t.split(' ').map(|x| x.parse::<usize>().unwrap());
    let (n, m) = (it.next().unwrap(), it.next().unwrap());
    
    let mut arr = vec![vec![];n];

    let mut filled = 0;

    for x in 0..m {
        let t = r.read_str(13);
        let mut it = t.split(' ');
        let (a, b) = (it.next().unwrap().to_owned(), it.next().unwrap().to_owned());

        let mut idx = Vec::with_capacity(100);

        for x in 0..filled {
            if &arr[x][0] == "" {
                break;
            }

            for (i, y) in arr[x].iter().enumerate() {
                if y == &a || y == &b {
                    idx.push(x);
                } else if y == "" {
                    break;
                }
            }
        }

        if idx.is_empty() {
            arr[filled].push(a.clone());
            arr[filled].push(b.clone());
            filled += 1;
        } else {
            for x in idx {
                let mut exists = (false, false);

                for x in &arr[x] {
                    if x == &a {
                        exists.0 = true;
                    }
                    if x == &b {
                        exists.1 = true;
                    }
                    if exists == (true, true) {
                        break;
                    }
                }
                if !exists.0 {
                    arr[x].push(a.clone());
                }
                if !exists.1 {
                    arr[x].push(b.clone());
                }
            }
        }
    }

    dbg!(&arr);

    let mut max = 0;

    for x in 0..filled {
        if arr[x].len() > max {
            max = arr[x].len();
        }
    }

    write!(w, "{}", max.max(filled));
}