N = int(input()) ans = 0 for x in range(N, int(N ** 0.5) - 1, -1): if x ** 2 == N: ans += x elif N % x == 0: ans += x + N // x print(ans)