n,m=gets.split.map &:to_i
ab=m.times.map { gets.split.map &:to_i }
friend_list = Hash.new { |h,k| h[k] = Array.new } 
ab.each do |v|
  a=v[0]
  b=v[1]
  friend_list[a] << b unless friend_list[a].include? b
  friend_list[b] << a unless friend_list[b].include? a
end
p friend_list.sort_by { |_k,v| v.size }.last[1].size + 1
