"""
The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.
Find the sum of all the primes below two million.
"""

def find_primes(bound) :
  primes = [True]*bound
  primes[0] = False
  
  result = []
  for i in range(1,bound+1) :
    if primes[i-1]:
      result.append(i)
      primes[2*i-1:bound:i] = [False]*len(primes[2*i-1:bound:i])
  return result
  
bound = 2000000 
primes = find_primes(bound)
print reduce(lambda x,y:x+y,primes)
18c547300bee108e0a6266911b9f74a573513ce9
"""
The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.
Find the sum of all the primes below two million.
"""

def find_primes(bound) :
  primes = [True]*bound
  primes[0] = False
  
  result = []
  for i in range(1,bound+1) :
    if primes[i-1]:
      result.append(i)
      primes[2*i-1:bound:i] = [False]*len(primes[2*i-1:bound:i])
  return result
  
bound = 2000000 
primes = find_primes(bound)
print reduce(lambda x,y:x+y,primes)