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 } }


## んんん 1個だけ TLE... どうすればいいのかな 

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

fGBelongings = Array.new(n)
fGMembers = []
fGSizes = []
fGNum = 0
visiteds = Array.new(n)
n.times do |i|
    next if visiteds[i]
    stack = [i]
    fGMembers[fGNum] = []
    until stack.empty? do
        h = stack.pop
        visiteds[h] = true
        unless fGBelongings[h] then
            fGBelongings[h] = fGNum
            fGMembers[fGNum].push(h)
        end
        adjs[h].each do |f|
            stack.push(f) unless visiteds[f]
        end
    end
    fGSizes[fGNum] = fGMembers[fGNum].size
    fGNum += 1
end

# p fGMembers
puts fGSizes.max