n=int(eval(input()))

p=0

for i in range(1,int(n**0.5)+2):

    j,k=divmod(n-i,i)

    p+=0 if k or j<=i else j

print(p)
n=int(eval(input()))

p=0

for i in range(1,int(n**0.5)+10):

    if n%i==0 and n//i-1>i:

        p+=n//i-1

print(p)
n = int(eval(input()))
p = 0
for i in range(1, int(n**0.5) + 2):
    j, k = divmod(n - i, i)
    p += 0 if k or j <= i else j
print(p)

n = int(eval(input()))
p = 0
for i in range(1, int(n**0.5) + 10):
    if n % i == 0 and n // i - 1 > i:
        p += n // i - 1
print(p)

-for i in range(1, int(n**0.5) + 2): -    j, k = divmod(n - i, i) -    p += 0 if k or j <= i else j +for i in range(1, int(n**0.5) + 10): +    if n % i == 0 and n // i - 1 > i: +        p += n // i - 1