N, M = gets.chomp.split.map(&:to_i)
AB = M.times.map{gets.chomp.split.map(&:to_i)}

friends = [0]*N
ans = 0

(1..N).each do |i|
  arr = []
  (0...M).each do |j|
    if AB[j][0] == i
      arr.push(AB[j][1])
      (0...M).each do |k|
    	if AB[k][0] == AB[j][1]
          arr.push(AB[k][1])
        elsif AB[k][1] == AB[j][1]
          arr.push(AB[k][0])
        end
      end
    elsif AB[j][1] == i
      arr.push(AB[j][0])
      (0...M).each do |k|
    	if AB[k][0] == AB[j][0]
          arr.push(AB[k][1])
        elsif AB[k][1] == AB[j][0]
          arr.push(AB[k][0])
        end
      end
    end
  end
  if arr.uniq.size > ans
    ans = arr.uniq.size
  end
end

puts ans