import math n = int(input()) list_num = list(range(1, n + 1)) list_num[0] = 0 for i in range(2, int(math.sqrt(n)) + 1): if list_num[i - 1] == 0: continue multiple = 2 while True: target = i * multiple if target > n: break list_num[i * multiple - 1] = 0 multiple += 1 print(sum(list_num))