p = [] for i in range(2,1001): cnt = 0 for j in range(1,i+1): if i%j == 0: cnt +=1 if cnt == 2: p.append(i) n = int(input()) ls = [i for i in p if i <= n] sm = 0 for i in ls: sm += i print(sm)