n,m = gets.split.map(&:to_i)
if m == 0
  puts n
  exit
end
ans = Array.new(n){[]}
(0...m).each do |i|
  a,b = gets.split.map(&:to_i).sort
  ans[a-1] << b-1 if not ans[a-1].any?(b-1)
end
res = 0
ans.each do |ai|
  res = [res,ai.length].max
end
puts res+1
