class UnionFind {
    constructor(N){
        this.par = new Array(N).fill(-1)
    }

    root(x) {
        if (this.par[x] < 0) return x;
        return this.par[x] = this.root(this.par[x]);
    }

    unite(x, y) {
        let rx = this.root(x);
        let ry = this.root(y);
        if (rx == ry) return;
        if(this.par[rx] > this.par[ry]) [rx, ry] = [ry, rx]
        this.par[rx] += this.par[ry]
        this.par[ry] = rx
    }

    isSame(x, y) {
        let rx = this.root(x);
        let ry = this.root(y);
        return rx == ry;
    }
    
    size(x) {
        return -this.par[this.root(x)];
    }
};

function main(arg) {
    
    arg = arg.split("\n")
    let [N,M] = arg[0].split(" ").map(Number)
    let A = arg.slice(1).map(x=>Number(x.split(" ")[0]))
    let B = arg.slice(1).map(x=>Number(x.split(" ")[1]))
    

    let tree = new UnionFind(N)
    for(let i=0; i<M; i++) {
        tree.unite(A[i]-1,B[i]-1)
    }

    let ans=0
    for(let i=0; i<N; i++) {
        ans = Math.max(ans, tree.size(i))
    }
    console.log(ans)
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))