n = gets().split().map(&:to_i)[0]

c = 0

m = (n ** (1.0 / 2)).ceil
for i in 1..([m, n-1].min)
    if (n - i) % i == 0
      r = (n - i) / i
      if r <= i
        break
      end
      c += r
    end
end

puts c
