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

hash = {}

(1..n).each do |i|
  set = Set.new()
  set << i
  hash[i] = set 
end

m.times do
  a,b = gets.chomp.split(" ").map(&:to_i)
  set = hash[a] + hash[b]
  hash[a] = set
  hash[b] = set
end

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