/**
 * n ????????´??°???????????????????????????????????????????´???°?????°???????????????????????°??????
 * ??\???
 * ??????????????? n ?????????????????????????¶???? n ?????? n ????????´??°????????????????????????
 * <p>
 * ??????
 * ??\???????????????????´???°?????°???????????????????????????????????????
 * <p>
 * ??¶?´?
 * 1 ??? n ??? 10,000
 * 2 ??? ?????????????????´??° ??? 10e8
 */

import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);

		int n = stdIn.nextInt();
		int[] numbers = new int[n];

		for (int i = 0; i < n; i++) {
			numbers[i] = stdIn.nextInt();
		}
		long start = System.currentTimeMillis();

		int counter = 0;
		int i;

		Outer:
		for (int number : numbers) {

			/*2????´???°*/
			if (number == 2) {
				counter++;
				continue;
			}

			/*1??¨??¶??°????´???°??§?????????*/
			if (number % 2 == 0 || number < 2) {
				continue;
			}

			/*??¶??°?????????????????? ????????°??????????????\????????°?????§???????????°??????*/
			for (i = 3; i < Math.sqrt(number); i += 2) {
				if (number % i == 0) {
					continue Outer;
				}
			}
			counter++;
		}

		long end = System.currentTimeMillis();
		System.out.println((end - start)  + "ms");

		System.out.println(counter);
	}



//?¨???¬???????????????????¨???°


}

/**
 * ????????¢?????´????????????????????????????????´??°  ??? 2 ????????? ?????§?????°??§?????????????????????????????????????????????????????§???
 * ?????¨??????????????????????????? ?????¨?????¨?????????  ???????¨?????????????????¨????????????????????????¶?????????????????????????????????????????¨?????§???????????????
 * ????????§??????????????????????????????????????????????????????
 * <p>
 * ?????????2 ??\????????¶??°????´???°??§??????????????¨????????¨????????°?¨????????????????????????????  ??????????????§???????????°????????¨???????????°?????????????????????????????¨?????§????????????
 * ???????????????????????\?????????????????????  ?????¢?????´??????????????????????????????????????????
 * <p>
 * ?´???°????????§?????????????????°  ???  ?????????????´??????? ??????????????¨????????§???????????¨???????????¨?????§????????????
 * ????????§????´???°??§???????????°???????????°??¨?¨?????????????
 * ????????°???31 ????´???°???????????????????????????31 ??? 2 ?????? 6 ?????§?????°??§?????£???????????°????????¨???????????¨??????????????????
 * ?????? 7 ??????30?????§?????°??§ 31 ????????????????????°????????¨???????????§????????°???
 * ?????§???????????? 2 ?????? 6 ?????§?????°??? 31 ????????????????????°??????????????¨???????????§???6 ????¶?????????°????????????????????¨???????§???????????????????
 * <p>
 * ??????????????¨????????¨???2 ?????? ??? ?????§??§????????????2 ??????  ?????§?????????????????????????????????????????????????????°??????????????§??? ?????¢?????´?????????????????????????????¨?????§????????????????????????????????°  ??? 1,000,000 ??¨????????¨ = 1,000 ??¨??????????´???´?????¢?????´?????????????????????????????? 1,000 ????????????????????????
 */