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
  n.times do |i|
    info[i].each do |j|
      t = info[j].dup
      t.delete(i)
      info[i].concat(t).sort!.uniq!
    end
  end
  break if infoc == info
end

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