package Profit;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Maximum_Profit {
	static int N = 0;// ????´???°
	static int cnt = 0;// ?´???°?????°
	static double AL[];// ????´?

	// ????´???°????????????????????§??????
	static boolean N_IsOver(int N) {
		boolean result;

		// ??????????????????
		result = N >= 0 && N <= 1000 ? true : false;
		return result;
	}

	// ????´?????????????????????§??????
	static boolean Num_IsOver(double num) {
		double min, max;
		boolean result;

		// ?????????????¨????
		min = 2;
		max = 100000000;

		result = num >= min && num <= max ? true : false;
		return result;
	}

	// ?´???°?????§??????
	static boolean Num_IsPrime(double num) {
		// ?????????
		boolean result = true;

		for (double i = 2; i <= num; i++) {
			if (num / i > 1 && num % i == 0) {
				result = false;
				break;
			}
		}
		return result;
	}

	public static void main(String[] args) throws IOException {
		// ??\?????¨????????°?????£?¨?
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		String buf;

		try {
			// ????´???°??\???
			System.out.println("????´???°?????\????????????????????????");
			buf = br.readLine();
			N = Integer.parseInt(buf);

			while (!N_IsOver(N)) {
				System.out.println("????´???°?????????????¶???????????????????\n?????\?????????????????????");
				buf = br.readLine();
				N = Integer.parseInt(buf);
			}
			AL = new double[N];

			// ????´???\???
			System.out.println(N + "???????´??????\????????????????????????");
			for (int i = 0; i < N; i++) {
				buf = br.readLine();
				AL[i] = Double.parseDouble(buf);
				while (!Num_IsOver(AL[i])) {
					System.out.println("????´??????????????¶???????????????????\n?????\?????????????????????");
					buf = br.readLine();
					AL[i] = Double.parseDouble(buf);
				}
			}

			// ?´???°?????°??????????????????
			for (int i = 0; i < N; i++) {
				if (Num_IsPrime(AL[i]))
					cnt++;
			}

			// ?´???°?????°?????¨???
			System.out.println(cnt);

			// ??°?????§???????????´??????????????????
		} catch (NumberFormatException e) {
			System.out.println("??????????????????????????????");
		}

	}

}