class Integer def divisor_list require 'prime' return [] if self <= 0 return [1] if self == 1 prime_division.map.with_index { |(base, k), i| s = i.zero? ? 0 : 1 (s..k).map { |n| base ** n } }.inject { |res, e| res + res.flat_map { |t| e.map { |v| t * v } } }.sort end end N = gets.to_i pass = Hash.new N.divisor_list.each do |n| m = N / n pass[n.to_s + m.to_s] = true pass[m.to_s + n.to_s] = true end puts pass.size