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
  if hash[b].nil?
    hash[b] = hash[a]
    hash[b] << b
  elsif !hash[a].include?(b)
    hash[b].each do |tmp|
      hash[tmp] = hash[a]
      hash[tmp] << tmp
    end
  end
end

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