function Main(input) {
	input = input.trim().split("\n").map(function(x) { return x.split(" ")});
	let N = parseInt(input[0][0], 10);
	let M = parseInt(input[0][1], 10);
	let arr_AB = [];
	for (let i = 0; i < M; i++){
		arr_AB.push(input[i + 1].map(e => parseInt(e, 10)));
	}
	let uf = new UnionFind(N);
	for (let i = 0; i < M; i++){
		uf.union(arr_AB[i][0] - 1, arr_AB[i][1] - 1);
	}
	let ans = 0;
	for (let i = 0; i <N; i++){
		ans = Math.max(ans, uf.size(i));
	}
	console.log(ans);
}

function UnionFind (n) {
    this.parents = [];
    for (let i = 0; i < n; i++) {
        this.parents.push(-1);
    }
}
UnionFind.prototype.find = function (x) {
    if (this.parents[x] < 0) return x;
    return this.parents[x] = this.find(this.parents[x]);    
}


UnionFind.prototype.union = function (x, y) {
    x = this.find(x);
    y = this.find(y);
    if (x === y) return;
    if (this.parents[x] > this.parents[y]) [x, y] = [y, x];
    
    this.parents[x] += this.parents[y];
    this.parents[y] = x;
}


UnionFind.prototype.size = function (x) {
    x = this.find(x);
    while (x >= 0) {
        x = this.parents[x];
    }
    return x * -1;
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
