/**
 * 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 ????????????????????????
 */ import java.util.Scanner; Scanner java.util 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);
	}



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


} 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);
	} main {
		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);
	} Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int n = stdIn.nextInt(); n stdIn.nextInt() stdIn.nextInt stdIn int[] numbers = new int[n]; numbers new int[n] n for (int i = 0; i < n; i++) {
			numbers[i] = stdIn.nextInt();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			numbers[i] = stdIn.nextInt();
		} {
			numbers[i] = stdIn.nextInt();
		} numbers[i] = stdIn.nextInt() numbers[i] numbers i stdIn.nextInt() stdIn.nextInt stdIn int counter = 0; counter 0 int i; i System.out.println(counter) System.out.println System.out System System.out counter String[] args args
/**
 * 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 ????????????????????????
 */