primelist = []
for i in range(0,2000000):
	if i > 1:
		for j in range(2,i//2+1):
			if (i%j) == 0:
				break
		else:
			primelist.append(i)
total = 0
for k in range(0,len(primelist)):
	total = total+primelist[j]
print(total)
