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 primes(n):
    ps, sieve = [], [True] * (n + 1)
    for p in range(2, n + 1):
        if sieve[p]:
           ps.append(p)
           for i in range(p * p, n + 1, p):
               sieve[i] = False
    return ps

l = input()
p = primes(l)
s = 0
for n in p:
	if n < l:
		s+=n
print s