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

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

max = 0
hash.each do |_k, v|
  l = v.length
  max = l if max < l 
end

puts max
