Composite Bag

View as PDF

Submit solution

Points: 3
Time limit: 2.0s
Memory limit: 64M

Authors:
Problem type

Alphonse like primes.

His friend Beryl, however, has gotten fed up with Alphonse’s antics. He decides that he will only be dealing with composite numbers in the future. Out of Alphonse’s N favorite positive integers, Beryl will take all those that are not prime and leave to go play Nintendogs. How many numbers will Beryl take?

Input Specifications

On the first line, the number N (1 \le N \le 1,000). On the next N lines, a single positive integer N_i (2 \le N_i \le 10^6).

Output Specifications

The number of numbers that Beryl takes.

Sample Input 1

5
7
12
20
19
123

Sample Output 1

3

Sample Input 2

7
21
23
101
72
51
19
4

Sample Output 2

4

Comments

There are no comments at the moment.