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

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

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

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

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