#K56622. Sum of Primes

    ID: 30240 Type: Default 1000ms 256MiB

Sum of Primes

Sum of Primes

Given a positive integer N, compute the sum of all prime numbers less than or equal to N. In mathematical terms, you need to calculate \( S = \sum_{p \le N,\, p \text{ is prime}} p \). The input is read from standard input and the output should be printed to standard output.

Example: For N = 10, the prime numbers are 2, 3, 5, and 7. Their sum is 17.

inputFormat

The input consists of a single integer N (\(1 \le N\le 10^6\)). This integer is provided via standard input.

outputFormat

Output a single integer which is the sum of all prime numbers up to and including N. The output should be printed to standard output.

## sample
10
17