require "set"
n,m = gets.chomp.split(" ").map(&:to_i)

hash = {}
m.times do
  a,b = gets.chomp.split(" ").map(&:to_i)
  a,b = b,a if b < a
  hash[a] ||= Set.new
  hash[a] << a
  hash[b] = hash[a]
  hash[b] << b
end

result = 0
hash.each do |k, v|
  result = v.length if v.length > result
end
puts result
