(async () => {
    let input = '';
    for await (const chunk of process.stdin) input += chunk;
    let lines = input.split(/\n/);
    const [n, m] = lines.shift().split(/\s+/);

    lines = lines.slice(0, m);
    
    let friends = [];
    lines.forEach(line => {
        const [a, b] = line.split(/\s+/).map(v => v - 1);
        const groups = friends.filter(f => f.has(a) || f.has(b));
        if(groups.length == 0){
            groups[0] = new Set();
            friends.push(groups[0]);
        }
        groups[0].add(a);
        groups[0].add(b);
        if(groups.length > 1){
            console.log(groups);
            let group = groups[0]
            for (let i = 1; i < groups.length; i++) {
                friends.splice(friends.indexOf(groups[i], 1));
                groups[i].forEach(f => {
                    group.add(f);
                });
            }
        }
    });

    console.log(friends.reduce((count, group) => Math.max(count, group.size), 0));

})();
