#C11098. Sum of Primes

    ID: 40376 Type: Default 1000ms 256MiB

Sum of Primes

Sum of Primes

Given an integer n, compute the sum of all prime numbers that are less than or equal to n. A prime number is an integer greater than 1 that has no divisors other than 1 and itself. The sum can be represented by the formula \(\sum_{p \leq n} p\), where \(p\) is a prime number.

Your solution should read input from standard input (stdin) and output the result to standard output (stdout). This problem requires an efficient algorithm to handle large values of n (up to \(10^6\)).

inputFormat

The input consists of a single integer n (\(0 \leq n \leq 10^6\)) provided on one line from standard input.

outputFormat

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

## sample
10
17

</p>