Snuke received a positive integer N from Takahashi. A positive integer m is called a _favorite number_ when the following condition is satisfied:    * The quotient and remainder of N divided by m are equal, that is, \lfloor \frac{N}{m} \rfloor = N \bmod m holds.  Find all favorite numbers and print the sum of those.
N = int(input())
ans = 0
for i in range(1,int(N**(0.5))):
    if N%i == 0:
        ans += N//i -1
print(ans)
N = int(input())
ans = 0
for i in range(1,int(N**(0.5))+1):
    if N%i == 0 and N//i > i+1:
        ans += N//i - 1
print(ans)