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)
end

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

puts max == 0 ? 1 : max
