require 'complex'
def divisors(n)
    cnt = 0
    for i in 1..(Math.sqrt(n).ceil) do
        if n % i == 0 and n / i - 1 > i then
            cnt += n / i - 1     
        end
    end
    return cnt
end

N = gets.chomp.to_i

puts divisors(N)
