import math

n=int(eval(input()))



x=n**0.5



if x-x//1!=0:

    x=int(x//1)

else:

    x=int(x//1)-1

y=0



for i in range(1,x+1):

    if (n-i)/i-(n-i)//i==0:

        if int((n-i)//i)!=i:

            y+=int((n-i)//i)



print(y)

        



     



    



     



    

n=int(eval(input()))

ans=0

if n==1 or n==2:

    print((0))

    exit()



for i in range(n):

    if i**2>=n:

        x=i

        break



for i in range(1,x):

    if n%i==0:

        if n//i>i+1:

            ans+=n//i-1



print(ans)
import math

n = int(eval(input()))
x = n**0.5
if x - x // 1 != 0:
    x = int(x // 1)
else:
    x = int(x // 1) - 1
y = 0
for i in range(1, x + 1):
    if (n - i) / i - (n - i) // i == 0:
        if int((n - i) // i) != i:
            y += int((n - i) // i)
print(y)

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

-import math - -x = n**0.5 -if x - x // 1 != 0: -    x = int(x // 1) -else: -    x = int(x // 1) - 1 -y = 0 -for i in range(1, x + 1): -    if (n - i) / i - (n - i) // i == 0: -        if int((n - i) // i) != i: -            y += int((n - i) // i) -print(y) +ans = 0 +if n == 1 or n == 2: +    print((0)) +    exit() +for i in range(n): +    if i**2 >= n: +        x = i +        break +for i in range(1, x): +    if n % i == 0: +        if n // i > i + 1: +            ans += n // i - 1 +print(ans)