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}
  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

max = 0

edges.each do |k, list|
  next if list.nil?
  all = list.push(k)
  cnt = all.uniq.length
  max = cnt if max < cnt
end

puts max == 0 ? 1 : max
