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

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