#C12945. Sum of Prime Numbers in a List

    ID: 42428 Type: Default 1000ms 256MiB

Sum of Prime Numbers in a List

Sum of Prime Numbers in a List

This problem requires you to compute the sum of all prime numbers in a given list of integers. A prime number is defined as an integer \(n\) that satisfies \(n > 1\) and has no positive divisors other than 1 and \(n\) itself. If the list contains no prime numbers, the result should be 0.

For example, given the list [4, 6, 9, 11, 20, 23], the prime numbers are 11 and 23, so their sum is 34.

inputFormat

The first line of input contains an integer \(N\), which represents the number of elements in the list. The second line contains \(N\) space-separated integers, which are the elements of the list.

outputFormat

Output a single integer which is the sum of all prime numbers present in the list. If no prime numbers exist, output 0.

## sample
6
4 6 9 11 20 23
34