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