require 'set'
n = gets.to_i
res = 0

s = Set[]
(1..n).each do |i|
  a = n/(i+1)+1
  b = n/i
  break if a >= b

  raise '%d' % [b-1] if s.include?(b-1)
  s << b-1

  res+=b-1 if(n/(b-1) == n % (b-1))
end

puts res