Problem: Problem Statement
Given an integer N, find the sum of all primes < N.
Input Format
The only line of the input file contains a positive integer N.

Output Format
Output the sum of all primes < N.

Constraints
1 ≤ N ≤ 4000000
You are guaranteed that the answer will fit in a 64-bit integer.

SAMPLE INPUT
1000

SAMPLE OUTPUT
76127

Solution (in PYTHON):

Solution:
from math import sqrt
import sys

def sieveOfErat(end):
  if end < 2: return []

  lng = int((end/2)-1+end%2)
  sieve = [True]*(lng+1)

  for i in range(int(sqrt(end)) >> 1):

    if not sieve[i]: continue

    for j in range( (i*(i + 3) << 1) + 3, lng, (i << 1) + 3):
      sieve[j] = False
      
  primes = [2]

  primes.extend([(i << 1) + 3 for i in range(lng) if sieve[i]])
  
  return primes

lsta = sieveOfErat(int(sys.stdin.readline())-1)

print(sum(lsta))