N = int(input()) ans = 0 M = N for i in range(2, N + 1): if M % i == 0: while M % i == 0: M //= i ans += i print(ans)