N,M = gets.split.map(&:to_i)
s = []
ms = 0
M.times do
  a,b = gets.split.map(&:to_i)
  a = (s[a]||={a=>1})
  b = (s[b]||={b=>1})
  a,b = b,a if a.size < b.size
  a.merge!(b)
  b.each do |k,v|
    s[k] = a
  end
  ms = a.size if ms < a.size 
end
puts ms
