#K44327. Sum of Primes

    ID: 27507 Type: Default 1000ms 256MiB

Sum of Primes

Sum of Primes

You are given a list of integers. Your task is to compute the sum of all prime numbers in the list. A number \( n \) is considered prime if it is greater than 1 and has no positive divisors other than 1 and itself. Formally, \( n \) is prime if it satisfies \( n > 1 \) and for every integer \( d \) such that \( 2 \le d \le \sqrt{n} \), \( d \) does not divide \( n \).

Input is read from standard input (stdin) and output should be written to standard output (stdout). Use the input format described below.

inputFormat

The first line of input contains an integer \( n \) indicating the number of integers. The second line contains \( n \) space-separated integers.

outputFormat

Output a single integer, which is the sum of all primes in the given list.

## sample
5
3 4 2 7 8
12

</p>