N = int(input()) ans = [] for x in range(1, int(N ** 0.5) + 1): if N % x == 0: if x ** 2 == N: ans += [x] else: ans += [x, N // x] print(sum(ans))