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

check = Array.new(n){[]}
max = 1
m.times do
  a,b = gets.split.map(&:to_i).sort
  next if check[a-1].any?(b)
  check[a-1] << b
  max = [max,check[a-1].length+1].max
end
puts max
