# -*- coding: utf-8 -*-
"""
Created on Wed Aug 06 19:34:47 2014

@author: Kyle
"""
#def isprime(n):
#    prime=True
#    for i in range(2,n/2+1):
#            prime=False
#            return False
#            break
#    return prime
#    
sum=0
n=2000000
long(sum)

for i in range(2,n+1):
    if isprime(i):
        sum=sum+i
print sum