(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.includes(a) || f.includes(b));
        if(groups.length == 0){
            friends.push([a, b]);
        }else{
            if(!groups[0].includes(a)){
                groups[0].push(a);
            }
            if(!groups[0].includes(b)){
                groups[0].push(b);
            }
        }
        if(groups.length > 1){
            console.log(groups);
            let index = friends.indexOf(groups[0]);
            let group = groups[0]
            for (let i = 1; i < groups.length; i++) {
                friends.splice(friends.indexOf(groups[i], 1));
                group = group.join(groups[i]);
            }
            friends[index] = group;
        }
    });

    let groupCount = 0;
    friends.forEach(group => {
        const friend = new Set();
        for(const e of group){
            friend.add(e);
        }
        groupCount = Math.max(groupCount, friend.size);
    })

    console.log(groupCount);

})();
