require 'set'
n,m = gets.split.map(&:to_i)
check = Array.new(n+1){Set.new}
max = 1
m.times do
  a,b = gets.split.map(&:to_i)
  max = [max,check[b].length+1].max if check[b].add?(a)
  max = [max,check[a].length+1].max if check[a].add?(b)
end
puts max