n,m=gets.split.map &:to_i
arr=(1..n).to_a
ab=m.times.map { gets.split.map &:to_i }
friend_list = Hash.new { |h,k| h[k] = Array.new } 
#p ab
m.times do |i|
  #p ab[i]
  #puts "ab[0]: #{ab[i][0]}, ab[1]: #{ab[i][1]}" 
  friend_list[ab[i][0]] << ab[i][1] unless friend_list[ab[i][0]].include? ab[i][1]
  friend_list[ab[i][1]] << ab[i][0] unless friend_list[ab[i][1]].include? ab[i][0]
end
#p friend_list
=begin
past = []
friend_list.each do |k,v|
  friend_list[k] = arr - v  - [k] - past
  past += friend_list[k]
end
p friend_list
=end
p res =  friend_list.sort_by { |_k,v| v.size }.to_h.values.last.size + 1
