N = int(input()) li = [i for i in range(2, N)] for j in range(2, N): if li[j] != 0: k = 2 while j*k < N: li[j*k] = 0 k += 1 print(sum(li))