N = int(input()) ans = 1 x = 2 while x*x <= N: if N % x == 0: c = 1 while N % x == 0: N //= x c += 1 ans *= (x**c - 1)//(x-1) x += 1 if N > 1: ans *= 1 + N print(ans)