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

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

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

n.times do |i|
  info = friends.dup
  info[i].each do |j|
    info[i].concat(info[j]).sort!.uniq!
    info[i].delete(i)
  end
  friends = info if friends != info
end

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