n, m = gets.strip.split.map(&:to_i)

info = Array.new(n).map { Array.new }

m.times do
  a, b = gets.strip.split.map { |_| _.to_i - 1 }
  info[b] << a
  info[a] << b
  info[a].uniq!
  info[b].uniq!
end

loop do
  infoc = info.dup
  info.each_with_index do |i, ii|
    i.each do |j|
      info[ii] = info[ii] + info[j]
      info[ii].delete(ii)
    end
    info[ii].uniq!
  end
  break if infoc == info
end

ml = info.max_by { |v| v.length }
puts ml.length + 1
