n = int(eval(input()))

ans = 0

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

    if n % i == 0:

        ans += n // i - 1

print(ans)

n=int(eval(input()))

print((sum(n//i-1 for i in range(1,int((n+1)**0.5)) if n%i<1)))

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

n = int(eval(input()))
print((sum(n // i - 1 for i in range(1, int((n + 1) ** 0.5)) if n % i < 1)))

-ans = 0 -for i in range(1, int((n + 1) ** 0.5)): -    if n % i == 0: -        ans += n // i - 1 -print(ans) +print((sum(n // i - 1 for i in range(1, int((n + 1) ** 0.5)) if n % i < 1)))