neprim

Time limit: 1s Memory limit: 256MB Input: neprim.in Output: neprim.out

Task

You are given nn numbers. Find how many numbers are there in the array which are prime nonprime.

A prime nonprime number is a number such that all of its digits are prime, but the number is not prime.

Input data

The first line of the input file neprim.in contains nn, the number of integers from the array. The next line contains nn positive integers which have at most 99 digits.

Output data

The first line of the output file neprim.out contains a single integer, the number of prime nonprime numbers from the array.

Constraints and clarifications

  • 1n10001 \leq n \leq 1000;
  • 1vi<1091 \leq v_i < 10^9;

Example

neprim.in

6
34 23 130 325 777 120

neprim.out

2

Explanation

The two numbers which are prime nonprime in the array are 325325 (it is a multiple of 55) and 777777 (it is a multiple of 111111).

Log in or sign up to be able to send submissions!