n=int(eval(input()))



ans = 0



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

    if n%i == 0 and n//i>=i+2:

        ans += (n//i)-1

print(ans)
def prime(p):

    memo = [p]

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

        if p%i == 0:

            memo.append(i)

            memo.append(p//i)

    return memo



x = int(eval(input()))



if x== 1:

    print((0))

    exit()



memo = prime(x)



ans = 0



for i in memo:

    if x%(i-1)==x//(i-1):

        ans += i-1

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

def prime(p):
    memo = [p]
    for i in range(2, (int(p**0.5) + 1)):
        if p % i == 0:
            memo.append(i)
            memo.append(p // i)
    return memo


x = int(eval(input()))
if x == 1:
    print((0))
    exit()
memo = prime(x)
ans = 0
for i in memo:
    if x % (i - 1) == x // (i - 1):
        ans += i - 1
print(ans)

-n = int(eval(input())) +def prime(p): +    memo = [p] +    for i in range(2, (int(p**0.5) + 1)): +        if p % i == 0: +            memo.append(i) +            memo.append(p // i) +    return memo + + +x = int(eval(input())) +if x == 1: +    print((0)) +    exit() +memo = prime(x) -for i in range(1, int(n**0.5) + 2): -    if n % i == 0 and n // i >= i + 2: -        ans += (n // i) - 1 +for i in memo: +    if x % (i - 1) == x // (i - 1): +        ans += i - 1