N = int(input()) l = [0]*(N+1) for i in range(1,N+1): for j in range(i,N+1,i): l[j] += 1 ans = 0 for i in range(2,N+1): if l[i] == 2: ans += i print(ans)