n = int(eval(input()))



result = 0

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

    if n%i==0:

        x = n//i -1

        if x > i:

            result += x

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

print((sum([n//i-1 for i in range(1, int(n**(1/2))+1) if (n%i==0) and (n//i-1 > i)])))
n = int(eval(input()))
result = 0
for i in range(1, int(n ** (1 / 2) + 1)):
    if n % i == 0:
        x = n // i - 1
        if x > i:
            result += x
print(result)

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

-result = 0 -for i in range(1, int(n ** (1 / 2) + 1)): -    if n % i == 0: -        x = n // i - 1 -        if x > i: -            result += x -print(result) +print( +    ( +        sum( +            [ +                n // i - 1 +                for i in range(1, int(n ** (1 / 2)) + 1) +                if (n % i == 0) and (n // i - 1 > i) +            ] +        ) +    ) +)