import java.util.Scanner;
public class Main {
	int n;
	int list[];
	boolean sieve[];
	public static void main(String main[]) {
		new Main();
	}
	Main() {
		Scanner scan = new Scanner(System.in);
		n = scan.nextInt();
		list = new int[n];
		int max = 0;
		for (int i = 0; i < n; i++) {
			list [i] = scan.nextInt();
			max = Math.max(max, list[i]);
		}
		sieve = new boolean[max + 1];
		int sqMax = (int)Math.round(Math.sqrt(max));
		for (int i = 2; i <= sqMax; i++) {
			if (sieve[i])continue;
			int j = 2;
			while (i * j < max + 1) {
				sieve[i * j] = true;
				j++;
			}
		}
		int cnt = 0;
		for (int i = 0; i < n; i++) {
			if (!sieve[list[i]]) {
				cnt++;
			}
		}
		System.out.println(cnt);
	}
}
 import java.util.Scanner; Scanner java.util public class Main {
	int n;
	int list[];
	boolean sieve[];
	public static void main(String main[]) {
		new Main();
	}
	Main() {
		Scanner scan = new Scanner(System.in);
		n = scan.nextInt();
		list = new int[n];
		int max = 0;
		for (int i = 0; i < n; i++) {
			list [i] = scan.nextInt();
			max = Math.max(max, list[i]);
		}
		sieve = new boolean[max + 1];
		int sqMax = (int)Math.round(Math.sqrt(max));
		for (int i = 2; i <= sqMax; i++) {
			if (sieve[i])continue;
			int j = 2;
			while (i * j < max + 1) {
				sieve[i * j] = true;
				j++;
			}
		}
		int cnt = 0;
		for (int i = 0; i < n; i++) {
			if (!sieve[list[i]]) {
				cnt++;
			}
		}
		System.out.println(cnt);
	}
} Main int n; n int list[]; list boolean sieve[]; sieve public static void main(String main[]) {
		new Main();
	} main {
		new Main();
	} new Main() String main[] main Main() {
		Scanner scan = new Scanner(System.in);
		n = scan.nextInt();
		list = new int[n];
		int max = 0;
		for (int i = 0; i < n; i++) {
			list [i] = scan.nextInt();
			max = Math.max(max, list[i]);
		}
		sieve = new boolean[max + 1];
		int sqMax = (int)Math.round(Math.sqrt(max));
		for (int i = 2; i <= sqMax; i++) {
			if (sieve[i])continue;
			int j = 2;
			while (i * j < max + 1) {
				sieve[i * j] = true;
				j++;
			}
		}
		int cnt = 0;
		for (int i = 0; i < n; i++) {
			if (!sieve[list[i]]) {
				cnt++;
			}
		}
		System.out.println(cnt);
	} Main {
		Scanner scan = new Scanner(System.in);
		n = scan.nextInt();
		list = new int[n];
		int max = 0;
		for (int i = 0; i < n; i++) {
			list [i] = scan.nextInt();
			max = Math.max(max, list[i]);
		}
		sieve = new boolean[max + 1];
		int sqMax = (int)Math.round(Math.sqrt(max));
		for (int i = 2; i <= sqMax; i++) {
			if (sieve[i])continue;
			int j = 2;
			while (i * j < max + 1) {
				sieve[i * j] = true;
				j++;
			}
		}
		int cnt = 0;
		for (int i = 0; i < n; i++) {
			if (!sieve[list[i]]) {
				cnt++;
			}
		}
		System.out.println(cnt);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) n = scan.nextInt() n scan.nextInt() scan.nextInt scan list = new int[n] list new int[n] n int max = 0; max 0 for (int i = 0; i < n; i++) {
			list [i] = scan.nextInt();
			max = Math.max(max, list[i]);
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			list [i] = scan.nextInt();
			max = Math.max(max, list[i]);
		} {
			list [i] = scan.nextInt();
			max = Math.max(max, list[i]);
		} list [i] = scan.nextInt() list [i] list i scan.nextInt() scan.nextInt scan max = Math.max(max, list[i]) max Math.max(max, list[i]) Math.max Math max list[i] list i sieve = new boolean[max + 1] sieve new boolean[max + 1] max + 1 max 1 int sqMax = (int)Math.round(Math.sqrt(max)); sqMax (int)Math.round(Math.sqrt(max)) Math.round Math Math.sqrt(max) Math.sqrt Math max for (int i = 2; i <= sqMax; i++) {
			if (sieve[i])continue;
			int j = 2;
			while (i * j < max + 1) {
				sieve[i * j] = true;
				j++;
			}
		} int i = 2; int i = 2; i 2 i <= sqMax i sqMax i++ i++ i {
			if (sieve[i])continue;
			int j = 2;
			while (i * j < max + 1) {
				sieve[i * j] = true;
				j++;
			}
		} {
			if (sieve[i])continue;
			int j = 2;
			while (i * j < max + 1) {
				sieve[i * j] = true;
				j++;
			}
		} if (sieve[i])continue; sieve[i] sieve i continue; int j = 2; j 2 while (i * j < max + 1) {
				sieve[i * j] = true;
				j++;
			} i * j < max + 1 i * j i j max + 1 max 1 {
				sieve[i * j] = true;
				j++;
			} sieve[i * j] = true sieve[i * j] sieve i * j i j true j++ j int cnt = 0; cnt 0 for (int i = 0; i < n; i++) {
			if (!sieve[list[i]]) {
				cnt++;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			if (!sieve[list[i]]) {
				cnt++;
			}
		} {
			if (!sieve[list[i]]) {
				cnt++;
			}
		} if (!sieve[list[i]]) {
				cnt++;
			} !sieve[list[i]] sieve[list[i]] sieve list[i] list i {
				cnt++;
			} cnt++ cnt System.out.println(cnt) System.out.println System.out System System.out cnt public class Main {
	int n;
	int list[];
	boolean sieve[];
	public static void main(String main[]) {
		new Main();
	}
	Main() {
		Scanner scan = new Scanner(System.in);
		n = scan.nextInt();
		list = new int[n];
		int max = 0;
		for (int i = 0; i < n; i++) {
			list [i] = scan.nextInt();
			max = Math.max(max, list[i]);
		}
		sieve = new boolean[max + 1];
		int sqMax = (int)Math.round(Math.sqrt(max));
		for (int i = 2; i <= sqMax; i++) {
			if (sieve[i])continue;
			int j = 2;
			while (i * j < max + 1) {
				sieve[i * j] = true;
				j++;
			}
		}
		int cnt = 0;
		for (int i = 0; i < n; i++) {
			if (!sieve[list[i]]) {
				cnt++;
			}
		}
		System.out.println(cnt);
	}
} public class Main {
	int n;
	int list[];
	boolean sieve[];
	public static void main(String main[]) {
		new Main();
	}
	Main() {
		Scanner scan = new Scanner(System.in);
		n = scan.nextInt();
		list = new int[n];
		int max = 0;
		for (int i = 0; i < n; i++) {
			list [i] = scan.nextInt();
			max = Math.max(max, list[i]);
		}
		sieve = new boolean[max + 1];
		int sqMax = (int)Math.round(Math.sqrt(max));
		for (int i = 2; i <= sqMax; i++) {
			if (sieve[i])continue;
			int j = 2;
			while (i * j < max + 1) {
				sieve[i * j] = true;
				j++;
			}
		}
		int cnt = 0;
		for (int i = 0; i < n; i++) {
			if (!sieve[list[i]]) {
				cnt++;
			}
		}
		System.out.println(cnt);
	}
} Main
import java.util.Scanner;
public class Main {
	int n;
	int list[];
	boolean sieve[];
	public static void main(String main[]) {
		new Main();
	}
	Main() {
		Scanner scan = new Scanner(System.in);
		n = scan.nextInt();
		list = new int[n];
		int max = 0;
		for (int i = 0; i < n; i++) {
			list [i] = scan.nextInt();
			max = Math.max(max, list[i]);
		}
		sieve = new boolean[max + 1];
		int sqMax = (int)Math.round(Math.sqrt(max));
		for (int i = 2; i <= sqMax; i++) {
			if (sieve[i])continue;
			int j = 2;
			while (i * j < max + 1) {
				sieve[i * j] = true;
				j++;
			}
		}
		int cnt = 0;
		for (int i = 0; i < n; i++) {
			if (!sieve[list[i]]) {
				cnt++;
			}
		}
		System.out.println(cnt);
	}
}

