#C14021. Sum of Primes

    ID: 43625 Type: Default 1000ms 256MiB

Sum of Primes

Sum of Primes

Given a positive integer n, calculate the sum of all prime numbers that are less than or equal to n. A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. You should design an efficient algorithm (for instance, by using the Sieve of Eratosthenes) that works well even for large values of n.

For example, when n = 10, the prime numbers are 2, 3, 5, and 7, and their sum is 17.

Input Constraints: n is a non-negative integer provided through standard input.

Note: Use standard input to read the input and standard output to write the result.

inputFormat

The input consists of a single line containing an integer n (n ≥ 0).

outputFormat

Output a single integer which is the sum of all prime numbers that are less than or equal to n.

## sample
10
17

</p>