class UnionFind
    def initialize(n)
        @parent = []
        @rank = []
 
        n.times do |i|
            @parent[i] = i
            @rank[i] = 0
        end
    end
    def findSet(x, c)
        @parent[x] = findSet(@parent[x], c+1) if c < 2 && x != @parent[x]
        @parent[x]
    end
    def same(x, y)
        findSet(x) == findSet(y)
    end
    def link(x, y)
        if @rank[x] > @rank[y] then
            @parent[y] = x
        else
            @parent[x] = y
            @rank[y] += 1 if @rank[x] == @rank[y]
        end
    end
    def unite(x, y)
        link(findSet(x, 0), findSet(y, 0))
    end
    def get_parent()
        return @parent
    end
end
 
n, m = gets.chomp.split.map(&:to_i)
uf = UnionFind.new(n)
ans = Hash.new(0)
m.times do
    a, b = gets.chomp.split.map(&:to_i)
    uf.unite(a-1, b-1)
end
group = uf.get_parent
group.each do |group_number|
    ans[group_number] += 1
end
puts ans.max{|x, y| x[1] <=> y[1]}[1]