import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int n = stdIn.nextInt();
		boolean[] prime = new boolean[100000000];
		Arrays.fill(prime,true);
		prime[0] = false;
		prime[1] = false;

		for (int i=2; i<100000000; i++) {
			if (prime[i]) {
				for (int j=i; j<100000000; j+=i) {
					prime[j] = false;
				}
				prime[i] = true;
			}
		}

		int count = 0;
		for (int i=0; i<n; i++) {
			if(prime[stdIn.nextInt()])
				count++;
		}
		System.out.println(count);
	}
} import java.util.*; util.* java class Main {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int n = stdIn.nextInt();
		boolean[] prime = new boolean[100000000];
		Arrays.fill(prime,true);
		prime[0] = false;
		prime[1] = false;

		for (int i=2; i<100000000; i++) {
			if (prime[i]) {
				for (int j=i; j<100000000; j+=i) {
					prime[j] = false;
				}
				prime[i] = true;
			}
		}

		int count = 0;
		for (int i=0; i<n; i++) {
			if(prime[stdIn.nextInt()])
				count++;
		}
		System.out.println(count);
	}
} Main public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int n = stdIn.nextInt();
		boolean[] prime = new boolean[100000000];
		Arrays.fill(prime,true);
		prime[0] = false;
		prime[1] = false;

		for (int i=2; i<100000000; i++) {
			if (prime[i]) {
				for (int j=i; j<100000000; j+=i) {
					prime[j] = false;
				}
				prime[i] = true;
			}
		}

		int count = 0;
		for (int i=0; i<n; i++) {
			if(prime[stdIn.nextInt()])
				count++;
		}
		System.out.println(count);
	} main {
		Scanner stdIn = new Scanner(System.in);
		int n = stdIn.nextInt();
		boolean[] prime = new boolean[100000000];
		Arrays.fill(prime,true);
		prime[0] = false;
		prime[1] = false;

		for (int i=2; i<100000000; i++) {
			if (prime[i]) {
				for (int j=i; j<100000000; j+=i) {
					prime[j] = false;
				}
				prime[i] = true;
			}
		}

		int count = 0;
		for (int i=0; i<n; i++) {
			if(prime[stdIn.nextInt()])
				count++;
		}
		System.out.println(count);
	} Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int n = stdIn.nextInt(); n stdIn.nextInt() stdIn.nextInt stdIn boolean[] prime = new boolean[100000000]; prime new boolean[100000000] 100000000 Arrays.fill(prime,true) Arrays.fill Arrays prime true prime[0] = false prime[0] prime 0 false prime[1] = false prime[1] prime 1 false for (int i=2; i<100000000; i++) {
			if (prime[i]) {
				for (int j=i; j<100000000; j+=i) {
					prime[j] = false;
				}
				prime[i] = true;
			}
		} int i=2; int i=2; i 2 i<100000000 i 100000000 i++ i++ i {
			if (prime[i]) {
				for (int j=i; j<100000000; j+=i) {
					prime[j] = false;
				}
				prime[i] = true;
			}
		} {
			if (prime[i]) {
				for (int j=i; j<100000000; j+=i) {
					prime[j] = false;
				}
				prime[i] = true;
			}
		} if (prime[i]) {
				for (int j=i; j<100000000; j+=i) {
					prime[j] = false;
				}
				prime[i] = true;
			} prime[i] prime i {
				for (int j=i; j<100000000; j+=i) {
					prime[j] = false;
				}
				prime[i] = true;
			} for (int j=i; j<100000000; j+=i) {
					prime[j] = false;
				} int j=i; int j=i; j i j<100000000 j 100000000 j+=i j+=i j i {
					prime[j] = false;
				} {
					prime[j] = false;
				} prime[j] = false prime[j] prime j false prime[i] = true prime[i] prime i true int count = 0; count 0 for (int i=0; i<n; i++) {
			if(prime[stdIn.nextInt()])
				count++;
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			if(prime[stdIn.nextInt()])
				count++;
		} {
			if(prime[stdIn.nextInt()])
				count++;
		} if(prime[stdIn.nextInt()])
				count++; prime[stdIn.nextInt()] prime stdIn.nextInt() stdIn.nextInt stdIn count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args
import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int n = stdIn.nextInt();
		boolean[] prime = new boolean[100000000];
		Arrays.fill(prime,true);
		prime[0] = false;
		prime[1] = false;

		for (int i=2; i<100000000; i++) {
			if (prime[i]) {
				for (int j=i; j<100000000; j+=i) {
					prime[j] = false;
				}
				prime[i] = true;
			}
		}

		int count = 0;
		for (int i=0; i<n; i++) {
			if(prime[stdIn.nextInt()])
				count++;
		}
		System.out.println(count);
	}
}