n,m = gets.split.map(&:to_i)
ans = Array.new(n){[]}
m.times do
  a,b = gets.split.map(&:to_i)
  ans[a-1].push(b).uniq!
  ans[b-1].push(a).uniq!
end
res = 0
ans.each do |ai|
  res = [res,ai.length].max
end
puts res+1
