def solution(): n = int(input()) if n == 1: return 0 res = 2 for i in range(3, n + 1, 2): res += i for j in range(2, i - 1): if i % j == 0: res -= i break return res print(solution())