n, m = gets.chomp.split(' ').map(&:to_i)
a = Array.new(m)
m.times { |i| a[i] = gets.chomp.split(' ').map { |e| e.to_i - 1 } }

adjs = Array.new(n){ [] }
a.each do |ary|
    s, t = ary
    adjs[s].push(t)
    adjs[t].push(s)
end

visiteds = Array.new(n)
ans = 0
n.times do |i|
    next if visiteds[i]
    stack = [i]
    visiteds[i] = true
    numOfGroupMembers = 1
    until stack.empty? do
        h = stack.pop
        adjs[h].each do |f|
            unless visiteds[f] then
                stack.push(f)
                visiteds[f] = true
                numOfGroupMembers += 1
            end
        end
    end
    ans = [ans, numOfGroupMembers].max
end
puts ans
