
//implement the sieve of eratos
import java.util.Scanner;


//we will use the filter method to construct the prime table from 1 to n


public class Main {
	//we can thus use binary search to check whether i is in the table
	static final int N = 100000000;
	
	
	
	// this is no good for java, so slow
	public static boolean[] eratos(int n){
		// the original value should be false
		boolean [] table = new boolean[n+1];
		
		table[0] = table[1] = true;
		
		int k = (int)Math.sqrt(n);
		for(int i = 2; i <= k; i++) {
			if(!table[i]) {
				for(int j = 2*i; j <= n; j+=i) {
					table[j] = true;
				}
			}
		}
		
		return table;
	}
	
	
	public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		boolean[] table = eratos(N);
		
		int len = cin.nextInt();
		int count = 0;

		
		while(len > 0) {
			count += (!table[cin.nextInt()])? 1:0;
			len--;
		}
		System.out.println(count);
	}


} import java.util.Scanner; Scanner java.util public class Main {
	//we can thus use binary search to check whether i is in the table
	static final int N = 100000000;
	
	
	
	// this is no good for java, so slow
	public static boolean[] eratos(int n){
		// the original value should be false
		boolean [] table = new boolean[n+1];
		
		table[0] = table[1] = true;
		
		int k = (int)Math.sqrt(n);
		for(int i = 2; i <= k; i++) {
			if(!table[i]) {
				for(int j = 2*i; j <= n; j+=i) {
					table[j] = true;
				}
			}
		}
		
		return table;
	}
	
	
	public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		boolean[] table = eratos(N);
		
		int len = cin.nextInt();
		int count = 0;

		
		while(len > 0) {
			count += (!table[cin.nextInt()])? 1:0;
			len--;
		}
		System.out.println(count);
	}


} Main //we can thus use binary search to check whether i is in the table
	static final int N = 100000000; N 100000000 // this is no good for java, so slow
	public static boolean[] eratos(int n){
		// the original value should be false
		boolean [] table = new boolean[n+1];
		
		table[0] = table[1] = true;
		
		int k = (int)Math.sqrt(n);
		for(int i = 2; i <= k; i++) {
			if(!table[i]) {
				for(int j = 2*i; j <= n; j+=i) {
					table[j] = true;
				}
			}
		}
		
		return table;
	} eratos {
		// the original value should be false
		boolean [] table = new boolean[n+1];
		
		table[0] = table[1] = true;
		
		int k = (int)Math.sqrt(n);
		for(int i = 2; i <= k; i++) {
			if(!table[i]) {
				for(int j = 2*i; j <= n; j+=i) {
					table[j] = true;
				}
			}
		}
		
		return table;
	} boolean [] table = new boolean[n+1]; table new boolean[n+1] n+1 n 1 table[0] = table[1] = true table[0] table 0 table[1] = true table[1] table 1 true int k = (int)Math.sqrt(n); k (int)Math.sqrt(n) Math.sqrt Math n for(int i = 2; i <= k; i++) {
			if(!table[i]) {
				for(int j = 2*i; j <= n; j+=i) {
					table[j] = true;
				}
			}
		} int i = 2; int i = 2; i 2 i <= k i k i++ i++ i {
			if(!table[i]) {
				for(int j = 2*i; j <= n; j+=i) {
					table[j] = true;
				}
			}
		} {
			if(!table[i]) {
				for(int j = 2*i; j <= n; j+=i) {
					table[j] = true;
				}
			}
		} if(!table[i]) {
				for(int j = 2*i; j <= n; j+=i) {
					table[j] = true;
				}
			} !table[i] table[i] table i {
				for(int j = 2*i; j <= n; j+=i) {
					table[j] = true;
				}
			} for(int j = 2*i; j <= n; j+=i) {
					table[j] = true;
				} int j = 2*i; int j = 2*i; j 2*i 2 i j <= n j n j+=i j+=i j i {
					table[j] = true;
				} {
					table[j] = true;
				} table[j] = true table[j] table j true return table; table int n n public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		boolean[] table = eratos(N);
		
		int len = cin.nextInt();
		int count = 0;

		
		while(len > 0) {
			count += (!table[cin.nextInt()])? 1:0;
			len--;
		}
		System.out.println(count);
	} main {
		Scanner cin = new Scanner(System.in);
		boolean[] table = eratos(N);
		
		int len = cin.nextInt();
		int count = 0;

		
		while(len > 0) {
			count += (!table[cin.nextInt()])? 1:0;
			len--;
		}
		System.out.println(count);
	} Scanner cin = new Scanner(System.in); cin new Scanner(System.in) boolean[] table = eratos(N); table eratos(N) eratos N int len = cin.nextInt(); len cin.nextInt() cin.nextInt cin int count = 0; count 0 while(len > 0) {
			count += (!table[cin.nextInt()])? 1:0;
			len--;
		} len > 0 len 0 {
			count += (!table[cin.nextInt()])? 1:0;
			len--;
		} count += (!table[cin.nextInt()])? 1:0 count (!table[cin.nextInt()])? 1:0 (!table[cin.nextInt()]) table[cin.nextInt()] table cin.nextInt() cin.nextInt cin 1 0 len-- len System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
	//we can thus use binary search to check whether i is in the table
	static final int N = 100000000;
	
	
	
	// this is no good for java, so slow
	public static boolean[] eratos(int n){
		// the original value should be false
		boolean [] table = new boolean[n+1];
		
		table[0] = table[1] = true;
		
		int k = (int)Math.sqrt(n);
		for(int i = 2; i <= k; i++) {
			if(!table[i]) {
				for(int j = 2*i; j <= n; j+=i) {
					table[j] = true;
				}
			}
		}
		
		return table;
	}
	
	
	public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		boolean[] table = eratos(N);
		
		int len = cin.nextInt();
		int count = 0;

		
		while(len > 0) {
			count += (!table[cin.nextInt()])? 1:0;
			len--;
		}
		System.out.println(count);
	}


} public class Main {
	//we can thus use binary search to check whether i is in the table
	static final int N = 100000000;
	
	
	
	// this is no good for java, so slow
	public static boolean[] eratos(int n){
		// the original value should be false
		boolean [] table = new boolean[n+1];
		
		table[0] = table[1] = true;
		
		int k = (int)Math.sqrt(n);
		for(int i = 2; i <= k; i++) {
			if(!table[i]) {
				for(int j = 2*i; j <= n; j+=i) {
					table[j] = true;
				}
			}
		}
		
		return table;
	}
	
	
	public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		boolean[] table = eratos(N);
		
		int len = cin.nextInt();
		int count = 0;

		
		while(len > 0) {
			count += (!table[cin.nextInt()])? 1:0;
			len--;
		}
		System.out.println(count);
	}


} Main

//implement the sieve of eratos
import java.util.Scanner;


//we will use the filter method to construct the prime table from 1 to n


public class Main {
	//we can thus use binary search to check whether i is in the table
	static final int N = 100000000;
	
	
	
	// this is no good for java, so slow
	public static boolean[] eratos(int n){
		// the original value should be false
		boolean [] table = new boolean[n+1];
		
		table[0] = table[1] = true;
		
		int k = (int)Math.sqrt(n);
		for(int i = 2; i <= k; i++) {
			if(!table[i]) {
				for(int j = 2*i; j <= n; j+=i) {
					table[j] = true;
				}
			}
		}
		
		return table;
	}
	
	
	public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		boolean[] table = eratos(N);
		
		int len = cin.nextInt();
		int count = 0;

		
		while(len > 0) {
			count += (!table[cin.nextInt()])? 1:0;
			len--;
		}
		System.out.println(count);
	}


}