#C14735. Filter and Count Prime Numbers
Filter and Count Prime Numbers
Filter and Count Prime Numbers
Given a list of integers, filter out all the prime numbers and count how many prime numbers are there in the list. A prime number is defined as a natural number greater than 1 that has no divisors other than 1 and itself. In mathematical terms, a number \( n \) is prime if \( n > 1 \) and the only divisors of \( n \) are 1 and \( n \).
Your task is to read the input from standard input (stdin), identify all prime numbers from the list and output them (space separated) on one line, followed by the count of these prime numbers on the next line. If there is no prime number in the list, output an empty line for the list and then 0 as the count.
inputFormat
The first line contains a single integer \( n \) representing the number of elements in the list. The second line contains \( n \) space-separated integers.
outputFormat
Output two lines. The first line should contain the prime numbers (if any) separated by a single space. The second line should contain the count of prime numbers.
## sample10
1 2 3 4 5 6 7 8 9 10
2 3 5 7
4
</p>