def divisors(N): U = int(N ** 0.5) + 1 L = [i for i in range(1, U) if N % i == 0] return L + [N // i for i in reversed(L) if N != i * i] N = int(input()) print(sum(divisors(N)))