/**
 * 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 ????????????????????????
 */
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz