import java.util.Scanner;

/**
 * 素数判定
 * @author nobu
 * @see <a href="http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_C&lang=ja">ALDS1_1_C</a>
 */
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();

		int answer = 0;
		for (int i = 0; i < n; i++) {
			if (isPrime(sc.nextInt())) answer++;
		}

		System.out.println(answer);

		sc.close();
	}

	private static boolean isPrime(int x) {
		if (x == 2) return true;
		if (x < 2 || x % 2 == 0) return false;

		for (int i = 3; i <= Math.sqrt(x); i += 2) {
			if (x % i == 0) return false;
		}
		return true;
	}

}
 import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();

		int answer = 0;
		for (int i = 0; i < n; i++) {
			if (isPrime(sc.nextInt())) answer++;
		}

		System.out.println(answer);

		sc.close();
	}

	private static boolean isPrime(int x) {
		if (x == 2) return true;
		if (x < 2 || x % 2 == 0) return false;

		for (int i = 3; i <= Math.sqrt(x); i += 2) {
			if (x % i == 0) return false;
		}
		return true;
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();

		int answer = 0;
		for (int i = 0; i < n; i++) {
			if (isPrime(sc.nextInt())) answer++;
		}

		System.out.println(answer);

		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();

		int answer = 0;
		for (int i = 0; i < n; i++) {
			if (isPrime(sc.nextInt())) answer++;
		}

		System.out.println(answer);

		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int answer = 0; answer 0 for (int i = 0; i < n; i++) {
			if (isPrime(sc.nextInt())) answer++;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			if (isPrime(sc.nextInt())) answer++;
		} {
			if (isPrime(sc.nextInt())) answer++;
		} if (isPrime(sc.nextInt())) answer++; isPrime(sc.nextInt()) isPrime sc.nextInt() sc.nextInt sc answer++ answer System.out.println(answer) System.out.println System.out System System.out answer sc.close() sc.close sc String[] args args private static boolean isPrime(int x) {
		if (x == 2) return true;
		if (x < 2 || x % 2 == 0) return false;

		for (int i = 3; i <= Math.sqrt(x); i += 2) {
			if (x % i == 0) return false;
		}
		return true;
	} isPrime {
		if (x == 2) return true;
		if (x < 2 || x % 2 == 0) return false;

		for (int i = 3; i <= Math.sqrt(x); i += 2) {
			if (x % i == 0) return false;
		}
		return true;
	} if (x == 2) return true; x == 2 x 2 return true; true if (x < 2 || x % 2 == 0) return false; x < 2 || x % 2 == 0 x < 2 x 2 x % 2 == 0 x % 2 x 2 0 return false; false for (int i = 3; i <= Math.sqrt(x); i += 2) {
			if (x % i == 0) return false;
		} int i = 3; int i = 3; i 3 i <= Math.sqrt(x) i Math.sqrt(x) Math.sqrt Math x i += 2 i += 2 i 2 {
			if (x % i == 0) return false;
		} {
			if (x % i == 0) return false;
		} if (x % i == 0) return false; x % i == 0 x % i x i 0 return false; false return true; true int x x public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();

		int answer = 0;
		for (int i = 0; i < n; i++) {
			if (isPrime(sc.nextInt())) answer++;
		}

		System.out.println(answer);

		sc.close();
	}

	private static boolean isPrime(int x) {
		if (x == 2) return true;
		if (x < 2 || x % 2 == 0) return false;

		for (int i = 3; i <= Math.sqrt(x); i += 2) {
			if (x % i == 0) return false;
		}
		return true;
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();

		int answer = 0;
		for (int i = 0; i < n; i++) {
			if (isPrime(sc.nextInt())) answer++;
		}

		System.out.println(answer);

		sc.close();
	}

	private static boolean isPrime(int x) {
		if (x == 2) return true;
		if (x < 2 || x % 2 == 0) return false;

		for (int i = 3; i <= Math.sqrt(x); i += 2) {
			if (x % i == 0) return false;
		}
		return true;
	}

} Main
import java.util.Scanner;

/**
 * 素数判定
 * @author nobu
 * @see <a href="http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_C&lang=ja">ALDS1_1_C</a>
 */
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();

		int answer = 0;
		for (int i = 0; i < n; i++) {
			if (isPrime(sc.nextInt())) answer++;
		}

		System.out.println(answer);

		sc.close();
	}

	private static boolean isPrime(int x) {
		if (x == 2) return true;
		if (x < 2 || x % 2 == 0) return false;

		for (int i = 3; i <= Math.sqrt(x); i += 2) {
			if (x % i == 0) return false;
		}
		return true;
	}

}

