New Year's '18 P2 - Mimi and Christmas Cake

View as PDF

Submit solution


Points: 5 (partial)
Time limit: 2.0s
Memory limit: 256M

Author:
Problem type

For Christmas, Mimi got a fruit cake from her parents. The cake is sliced into N slices, and the ith slice has fi pieces of fruit on it. However, as Mimi is trying to lose weight as a New Year's resolution, she will only eat slices which have a prime number of fruits on them. Help Mimi determine how many slices of cake she can eat.

Constraints

Subtask 1 [10%]

1N100
1fi100

Subtask 2 [10%]

1N105
1fi1000

Subtask 3 [80%]

1N105
1fi105

Input Specification

The first line of input will contain a single integer, N, the number of slices.
The next and final line of input will contain N space-separated integers: f1,f2,,fN, the number of pieces of fruit on the ith slice of cake.

Output Specification

A single integer, the number of slices of cake Mimi can eat.

Sample Input

Copy
3
1 5 8

Sample Output

Copy
1

Comments

There are no comments at the moment.