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
def soe(n):
    if n <= 2:
        return []
    sieve = range(3, n, 2)
    top = len(sieve)
    for si in sieve:
        if si:
            bottom = (si*si - 3) // 2
            if bottom >= top:
                break
            sieve[bottom::si] = [0] * -((bottom - top) // si)
    return [2] + [el for el in sieve if el]

t=input()
lst=soe(t)
s=0
for x in lst:
		s=s+int(x)
print s