input = readlines()
n, m = input.shift.chomp.split("\s").map{|x| x.to_i}

edges = {}
input.each do |l|
  a, b = l.chomp.split("\s").map{|x| x.to_i}.sort()
  edges[a] = [] if edges[a].nil?
  edges[a].push(b) unless edges[a].include?(b)
  unless edges[b].nil?
    edges[b].each do |member|
      edges[a].push(member) unless edges[a].include?(member)
    end
    edges[b] = nil
  end
end
# p edges
# def findChildren(edges, roots, current)
#   res = []
#   roots.each do |r|
#     next if edges[r].nil?
#     edges[r].each do |c|
#       next if current.include?(c)
#       res.push(c) unless res.include?(c)
#     end
#   end

#   res
# end
max = 0
# edges.each do |k, list|
#   next if list.nil?
#   members = [k]
#   list.each do |l|
#     members.push(l)
#   end
#   while(list.length > 0)
#     list = findChildren(edges, list, members)
#     list.each do |c|
#       members.push(c) unless members.include?(c)
#     end
#   end
#   max = members.length if members.length > max
# end

edges.each do |k, list|
  cnt = 1 + list.length
  max = cnt if max < cnt
end

puts max == 0 ? 1 : max
