import java.util.Scanner;

public class Main {
	final int MAX_N = 100000000;
	boolean[] primes;
	void eratosthenes() {
		primes = new boolean[MAX_N + 1];

		primes[2] = true;
		for (int i = 3; i <= MAX_N; i += 2)
			primes[i] = true;

		for (int i = 3; i <= Math.sqrt(MAX_N); i += 2) {
			if (!primes[i]) continue;
			for (int j = i * 2; j <= MAX_N; j += i)
				primes[j] = false;
		}
	}
	void run() {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int ans = 0;
		for (int i = 0; i < n; i++) {
			int v = scan.nextInt();
			ans += primes[v] ? 1 : 0;
		}
		System.out.println(ans);
	}
	public static void main(String[] args) {
		Main main = new Main();
		main.eratosthenes();
		main.run();
	}
}
 import java.util.Scanner; Scanner java.util public class Main {
	final int MAX_N = 100000000;
	boolean[] primes;
	void eratosthenes() {
		primes = new boolean[MAX_N + 1];

		primes[2] = true;
		for (int i = 3; i <= MAX_N; i += 2)
			primes[i] = true;

		for (int i = 3; i <= Math.sqrt(MAX_N); i += 2) {
			if (!primes[i]) continue;
			for (int j = i * 2; j <= MAX_N; j += i)
				primes[j] = false;
		}
	}
	void run() {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int ans = 0;
		for (int i = 0; i < n; i++) {
			int v = scan.nextInt();
			ans += primes[v] ? 1 : 0;
		}
		System.out.println(ans);
	}
	public static void main(String[] args) {
		Main main = new Main();
		main.eratosthenes();
		main.run();
	}
} Main final int MAX_N = 100000000; MAX_N 100000000 boolean[] primes; primes void eratosthenes() {
		primes = new boolean[MAX_N + 1];

		primes[2] = true;
		for (int i = 3; i <= MAX_N; i += 2)
			primes[i] = true;

		for (int i = 3; i <= Math.sqrt(MAX_N); i += 2) {
			if (!primes[i]) continue;
			for (int j = i * 2; j <= MAX_N; j += i)
				primes[j] = false;
		}
	} eratosthenes {
		primes = new boolean[MAX_N + 1];

		primes[2] = true;
		for (int i = 3; i <= MAX_N; i += 2)
			primes[i] = true;

		for (int i = 3; i <= Math.sqrt(MAX_N); i += 2) {
			if (!primes[i]) continue;
			for (int j = i * 2; j <= MAX_N; j += i)
				primes[j] = false;
		}
	} primes = new boolean[MAX_N + 1] primes new boolean[MAX_N + 1] MAX_N + 1 MAX_N 1 primes[2] = true primes[2] primes 2 true for (int i = 3; i <= MAX_N; i += 2)
			primes[i] = true; int i = 3; int i = 3; i 3 i <= MAX_N i MAX_N i += 2 i += 2 i 2 primes[i] = true; primes[i] = true primes[i] primes i true for (int i = 3; i <= Math.sqrt(MAX_N); i += 2) {
			if (!primes[i]) continue;
			for (int j = i * 2; j <= MAX_N; j += i)
				primes[j] = false;
		} int i = 3; int i = 3; i 3 i <= Math.sqrt(MAX_N) i Math.sqrt(MAX_N) Math.sqrt Math MAX_N i += 2 i += 2 i 2 {
			if (!primes[i]) continue;
			for (int j = i * 2; j <= MAX_N; j += i)
				primes[j] = false;
		} {
			if (!primes[i]) continue;
			for (int j = i * 2; j <= MAX_N; j += i)
				primes[j] = false;
		} if (!primes[i]) continue; !primes[i] primes[i] primes i continue; for (int j = i * 2; j <= MAX_N; j += i)
				primes[j] = false; int j = i * 2; int j = i * 2; j i * 2 i 2 j <= MAX_N j MAX_N j += i j += i j i primes[j] = false; primes[j] = false primes[j] primes j false void run() {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int ans = 0;
		for (int i = 0; i < n; i++) {
			int v = scan.nextInt();
			ans += primes[v] ? 1 : 0;
		}
		System.out.println(ans);
	} run {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int ans = 0;
		for (int i = 0; i < n; i++) {
			int v = scan.nextInt();
			ans += primes[v] ? 1 : 0;
		}
		System.out.println(ans);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int ans = 0; ans 0 for (int i = 0; i < n; i++) {
			int v = scan.nextInt();
			ans += primes[v] ? 1 : 0;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			int v = scan.nextInt();
			ans += primes[v] ? 1 : 0;
		} {
			int v = scan.nextInt();
			ans += primes[v] ? 1 : 0;
		} int v = scan.nextInt(); v scan.nextInt() scan.nextInt scan ans += primes[v] ? 1 : 0 ans primes[v] ? 1 : 0 primes[v] primes v 1 0 System.out.println(ans) System.out.println System.out System System.out ans public static void main(String[] args) {
		Main main = new Main();
		main.eratosthenes();
		main.run();
	} main {
		Main main = new Main();
		main.eratosthenes();
		main.run();
	} Main main = new Main(); main new Main() main.eratosthenes() main.eratosthenes main main.run() main.run main String[] args args public class Main {
	final int MAX_N = 100000000;
	boolean[] primes;
	void eratosthenes() {
		primes = new boolean[MAX_N + 1];

		primes[2] = true;
		for (int i = 3; i <= MAX_N; i += 2)
			primes[i] = true;

		for (int i = 3; i <= Math.sqrt(MAX_N); i += 2) {
			if (!primes[i]) continue;
			for (int j = i * 2; j <= MAX_N; j += i)
				primes[j] = false;
		}
	}
	void run() {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int ans = 0;
		for (int i = 0; i < n; i++) {
			int v = scan.nextInt();
			ans += primes[v] ? 1 : 0;
		}
		System.out.println(ans);
	}
	public static void main(String[] args) {
		Main main = new Main();
		main.eratosthenes();
		main.run();
	}
} public class Main {
	final int MAX_N = 100000000;
	boolean[] primes;
	void eratosthenes() {
		primes = new boolean[MAX_N + 1];

		primes[2] = true;
		for (int i = 3; i <= MAX_N; i += 2)
			primes[i] = true;

		for (int i = 3; i <= Math.sqrt(MAX_N); i += 2) {
			if (!primes[i]) continue;
			for (int j = i * 2; j <= MAX_N; j += i)
				primes[j] = false;
		}
	}
	void run() {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int ans = 0;
		for (int i = 0; i < n; i++) {
			int v = scan.nextInt();
			ans += primes[v] ? 1 : 0;
		}
		System.out.println(ans);
	}
	public static void main(String[] args) {
		Main main = new Main();
		main.eratosthenes();
		main.run();
	}
} Main
import java.util.Scanner;

public class Main {
	final int MAX_N = 100000000;
	boolean[] primes;
	void eratosthenes() {
		primes = new boolean[MAX_N + 1];

		primes[2] = true;
		for (int i = 3; i <= MAX_N; i += 2)
			primes[i] = true;

		for (int i = 3; i <= Math.sqrt(MAX_N); i += 2) {
			if (!primes[i]) continue;
			for (int j = i * 2; j <= MAX_N; j += i)
				primes[j] = false;
		}
	}
	void run() {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int ans = 0;
		for (int i = 0; i < n; i++) {
			int v = scan.nextInt();
			ans += primes[v] ? 1 : 0;
		}
		System.out.println(ans);
	}
	public static void main(String[] args) {
		Main main = new Main();
		main.eratosthenes();
		main.run();
	}
}

