require 'set'
n, m = gets.split.map(&:to_i)
f = Array.new(n+1)
(1..n).each do |i|
  f[i] = Set[i]
end
m.times do
  a, b = gets.split.map(&:to_i)
  g = f[a] + f[b]
  g.add(a).add(b)
  g.each do |i|
    f[i] = g
  end
end
ans = 1
f.each do |g|
  ans = g.size if g && ans < g.size
end
puts ans
