/**
 * n ????????´??°???????????????????????????????????????????´???°?????°???????????????????????°??????
 * ??\???
 ??????????????? n ?????????????????????????¶???? n ?????? n ????????´??°????????????????????????

 ??????
 ??\???????????????????´???°?????°???????????????????????????????????????

 ??¶?´?
 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();
		}

		int counter = 0;
		int i;
		for (int number : numbers) {
			for (i = 2; i < number; i++) {
				if (number % i == 0) {
					break;
				}
			}
			if (i == number) {
				counter++;
			}
		}

		System.out.println(counter);
	}
}