import math



n = int(eval(input()))

ans = 0

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

    if n%i == 0:

        m = n//i - 1

        if i < m: ans += m 

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

ans = 0

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

    if n%i == 0:

        # print('----',i)

        a = i

        x1 = n//i

        x = x1-1

        # print(a,x)

        if a < x:

            ans += x

        

        a = n//i

        x1 = i

        x = x1 - 1

        if a < x:

            ans += x



print(ans)
import math

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

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

-import math - -for i in range(1, int(-(-(n**0.5) // 1)) + 1): +for i in range(1, int(n**0.5) + 1): -        m = n // i - 1 -        if i < m: -            ans += m +        a = i +        x1 = n // i +        x = x1 - 1 +        # print(a,x) +        if a < x: +            ans += x +        a = n // i +        x1 = i +        x = x1 - 1 +        if a < x: +            ans += x