N, M = gets.split.map(&:to_i)
A = Array.new M
B = Array.new M
groups = []
members = Array.new N
M.times do |m|
    a, b = gets.split.map(&:to_i)
    if !members[a] && !members[b]
        groups.push([a,b])
        members[a] = members[b] = (groups.length - 1)
    elsif members[a] && members[b]
        unless members[a] == members[b]
            agroup = members[a]
            bgroup = members[b]
            
            groups[agroup].push(*groups[bgroup])
            groups[bgroup].each do |c|
                members[c] = agroup
            end
            groups[bgroup] = []
            members[b] = agroup
        end
    else
        g = members[a] || members[b]
        unless members[a]
            members[a] = g
            groups[g].push a
        end
        unless members[b]
            members[b] = g
            groups[g].push b
        end
    end
end

result = 1
groups.each do |g|
    if g.length > result
        result = g.length
    end
end

puts result