import java.util.Scanner;

class Main {
	public static void main(String[] args){
		int max = 100000001;
		boolean [] x = new boolean[max];
		
		PrimeList(x, max);
		
		Output(x);
	}
	
	private static void PrimeList (boolean x[], int max){
		int i;
		int j;
		double sqrt = Math.sqrt(max);
		
		for (i = 2; i < max; i++){
			x[i] = true;
		}
		
		for (i = 2; i < sqrt; i++){
			if (x[i]){
				for (j = i + i; j < max; j += i){
					x[j] = false;
				}
			}
		}
	}
	
	private static void Output(boolean x[]){
		Scanner cin = new Scanner(System.in);
		int n = cin.nextInt();
		int a;
		int count = 0;
		
		while (n > 0){
			a = cin.nextInt();
			if (x[a]){
				count++;
			}
			n--;
		}
		System.out.println(count);
	}
} import java.util.Scanner; Scanner java.util class Main {
	public static void main(String[] args){
		int max = 100000001;
		boolean [] x = new boolean[max];
		
		PrimeList(x, max);
		
		Output(x);
	}
	
	private static void PrimeList (boolean x[], int max){
		int i;
		int j;
		double sqrt = Math.sqrt(max);
		
		for (i = 2; i < max; i++){
			x[i] = true;
		}
		
		for (i = 2; i < sqrt; i++){
			if (x[i]){
				for (j = i + i; j < max; j += i){
					x[j] = false;
				}
			}
		}
	}
	
	private static void Output(boolean x[]){
		Scanner cin = new Scanner(System.in);
		int n = cin.nextInt();
		int a;
		int count = 0;
		
		while (n > 0){
			a = cin.nextInt();
			if (x[a]){
				count++;
			}
			n--;
		}
		System.out.println(count);
	}
} Main public static void main(String[] args){
		int max = 100000001;
		boolean [] x = new boolean[max];
		
		PrimeList(x, max);
		
		Output(x);
	} main {
		int max = 100000001;
		boolean [] x = new boolean[max];
		
		PrimeList(x, max);
		
		Output(x);
	} int max = 100000001; max 100000001 boolean [] x = new boolean[max]; x new boolean[max] max PrimeList(x, max) PrimeList x max Output(x) Output x String[] args args private static void PrimeList (boolean x[], int max){
		int i;
		int j;
		double sqrt = Math.sqrt(max);
		
		for (i = 2; i < max; i++){
			x[i] = true;
		}
		
		for (i = 2; i < sqrt; i++){
			if (x[i]){
				for (j = i + i; j < max; j += i){
					x[j] = false;
				}
			}
		}
	} PrimeList {
		int i;
		int j;
		double sqrt = Math.sqrt(max);
		
		for (i = 2; i < max; i++){
			x[i] = true;
		}
		
		for (i = 2; i < sqrt; i++){
			if (x[i]){
				for (j = i + i; j < max; j += i){
					x[j] = false;
				}
			}
		}
	} int i; i int j; j double sqrt = Math.sqrt(max); sqrt Math.sqrt(max) Math.sqrt Math max for (i = 2; i < max; i++){
			x[i] = true;
		} i = 2; i = 2 i 2 i < max i max i++ i++ i {
			x[i] = true;
		} {
			x[i] = true;
		} x[i] = true x[i] x i true for (i = 2; i < sqrt; i++){
			if (x[i]){
				for (j = i + i; j < max; j += i){
					x[j] = false;
				}
			}
		} i = 2; i = 2 i 2 i < sqrt i sqrt i++ i++ i {
			if (x[i]){
				for (j = i + i; j < max; j += i){
					x[j] = false;
				}
			}
		} {
			if (x[i]){
				for (j = i + i; j < max; j += i){
					x[j] = false;
				}
			}
		} if (x[i]){
				for (j = i + i; j < max; j += i){
					x[j] = false;
				}
			} x[i] x i {
				for (j = i + i; j < max; j += i){
					x[j] = false;
				}
			} for (j = i + i; j < max; j += i){
					x[j] = false;
				} j = i + i; j = i + i j i + i i i j < max j max j += i j += i j i {
					x[j] = false;
				} {
					x[j] = false;
				} x[j] = false x[j] x j false boolean x[] x int max max private static void Output(boolean x[]){
		Scanner cin = new Scanner(System.in);
		int n = cin.nextInt();
		int a;
		int count = 0;
		
		while (n > 0){
			a = cin.nextInt();
			if (x[a]){
				count++;
			}
			n--;
		}
		System.out.println(count);
	} Output {
		Scanner cin = new Scanner(System.in);
		int n = cin.nextInt();
		int a;
		int count = 0;
		
		while (n > 0){
			a = cin.nextInt();
			if (x[a]){
				count++;
			}
			n--;
		}
		System.out.println(count);
	} Scanner cin = new Scanner(System.in); cin new Scanner(System.in) int n = cin.nextInt(); n cin.nextInt() cin.nextInt cin int a; a int count = 0; count 0 while (n > 0){
			a = cin.nextInt();
			if (x[a]){
				count++;
			}
			n--;
		} n > 0 n 0 {
			a = cin.nextInt();
			if (x[a]){
				count++;
			}
			n--;
		} a = cin.nextInt() a cin.nextInt() cin.nextInt cin if (x[a]){
				count++;
			} x[a] x a {
				count++;
			} count++ count n-- n System.out.println(count) System.out.println System.out System System.out count boolean x[] x
import java.util.Scanner;

class Main {
	public static void main(String[] args){
		int max = 100000001;
		boolean [] x = new boolean[max];
		
		PrimeList(x, max);
		
		Output(x);
	}
	
	private static void PrimeList (boolean x[], int max){
		int i;
		int j;
		double sqrt = Math.sqrt(max);
		
		for (i = 2; i < max; i++){
			x[i] = true;
		}
		
		for (i = 2; i < sqrt; i++){
			if (x[i]){
				for (j = i + i; j < max; j += i){
					x[j] = false;
				}
			}
		}
	}
	
	private static void Output(boolean x[]){
		Scanner cin = new Scanner(System.in);
		int n = cin.nextInt();
		int a;
		int count = 0;
		
		while (n > 0){
			a = cin.nextInt();
			if (x[a]){
				count++;
			}
			n--;
		}
		System.out.println(count);
	}
}