#K39067. Count the Prime Numbers

    ID: 26338 Type: Default 1000ms 256MiB

Count the Prime Numbers

Count the Prime Numbers

Your task is to count the number of prime numbers in a given sequence. A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. The solution should read the input from standard input (stdin) and output the result to standard output (stdout).

Recall that a number \( p \) is prime if and only if it satisfies:

\[ p > 1 \quad \text{and} \quad \forall d \in \mathbb{N},\, (1 < d < p \Rightarrow p \mod d \neq 0). \]

You need to implement the program such that it passes all the provided test cases.

inputFormat

The first line of input contains a single integer \( n \), representing the number of elements in the sequence.

The second line contains \( n \) space-separated integers which form the sequence.

outputFormat

Output a single integer which is the count of prime numbers present in the sequence.

## sample
5
2 3 4 5 6
3

</p>