require 'bigdecimal'
n = $stdin.gets.to_i

def yakusuu(s)
  result = []

  (1..(Math.sqrt(s).to_i+1)).each do |i|
    if s % i == 0
      result << i
    end
  end
  result
end
sum = 0
yakusuu(n).each do |i|
  a = n / i
  sum += a - 1
end
puts sum
