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