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

set = Set.new

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] << b
  hash[b] ||= Set.new
  hash[b] << a
end

result = 1
(1..n).each do |i|
  next if set.include?(i) || hash[i].nil?
  arr = [i]
  count = 0
  while arr.length > 0 do
    a = arr.shift
    next if set.include?(a)
    set << a
    count += 1
    arr += hash[a].to_a
  end
  result = count if count > result
end

puts result
