n, m = gets.split.map(&:to_i)
h = {}
n.times{h[_1+1]=[_1+1]}
m.times do
  a, b = gets.split.map(&:to_i)
  h[a] << b
  h[b] << a
end
ans = 1
h.each do |id, list|
  ans = [ans, list.uniq.size].max
end
puts ans