N = int(eval(input()))

ans = 0

n = 1

while n*n < N:

    if (N-n)%n == 0:

        m = (N-n)//n

        if m <= n: break

        ans += m

    n += 1

print(ans)
N = int(eval(input()))



m = 1

ans = 0

while m*m <= N:

    if (N-m)%m == 0:

        d = (N-m)//m

        if d <= m: break

        ans += d

    m += 1

print(ans)
N = int(eval(input()))
ans = 0
n = 1
while n * n < N:
    if (N - n) % n == 0:
        m = (N - n) // n
        if m <= n:
            break
        ans += m
    n += 1
print(ans)

N = int(eval(input()))
m = 1
ans = 0
while m * m <= N:
    if (N - m) % m == 0:
        d = (N - m) // m
        if d <= m:
            break
        ans += d
    m += 1
print(ans)

+m = 1 -n = 1 -while n * n < N: -    if (N - n) % n == 0: -        m = (N - n) // n -        if m <= n: +while m * m <= N: +    if (N - m) % m == 0: +        d = (N - m) // m +        if d <= m: -        ans += m -    n += 1 +        ans += d +    m += 1