ans = 0 N = int(input()) i = 1 while i * i <= N: if N % i == 0: ans += i if i != N // i: ans += N // i i += 1 print(ans)