import java.io.*;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;
public class Main {
	static String a;
	static boolean[] isntPrime;
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		makePrimeList(100000000);
		int n = stdIn.nextInt();
		int count = 0;
		for(int i = 0; i < n; i++) {
			int x = stdIn.nextInt();
			if(x != 2 && x % 2 == 0) {
				continue;
			}
			if(!isntPrime[x]) {
				count++;
			}
		}
		System.out.println(count);
	}
	
	
	public static void makePrimeList(int n) {
		isntPrime = new boolean[n+1];
		isntPrime[0] = isntPrime[1] = true;
		for(int i = 3; i < n; i+=2) {
			if(!isntPrime[i]) {
				for(int j = i + i; j < n; j += i){
					isntPrime[j] = true;
				}
			}
		}
	}
} import java.io.*; io.* java import java.util.ArrayDeque; ArrayDeque java.util import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.Comparator; Comparator java.util import java.util.Scanner; Scanner java.util public class Main {
	static String a;
	static boolean[] isntPrime;
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		makePrimeList(100000000);
		int n = stdIn.nextInt();
		int count = 0;
		for(int i = 0; i < n; i++) {
			int x = stdIn.nextInt();
			if(x != 2 && x % 2 == 0) {
				continue;
			}
			if(!isntPrime[x]) {
				count++;
			}
		}
		System.out.println(count);
	}
	
	
	public static void makePrimeList(int n) {
		isntPrime = new boolean[n+1];
		isntPrime[0] = isntPrime[1] = true;
		for(int i = 3; i < n; i+=2) {
			if(!isntPrime[i]) {
				for(int j = i + i; j < n; j += i){
					isntPrime[j] = true;
				}
			}
		}
	}
} Main static String a; a static boolean[] isntPrime; isntPrime public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		makePrimeList(100000000);
		int n = stdIn.nextInt();
		int count = 0;
		for(int i = 0; i < n; i++) {
			int x = stdIn.nextInt();
			if(x != 2 && x % 2 == 0) {
				continue;
			}
			if(!isntPrime[x]) {
				count++;
			}
		}
		System.out.println(count);
	} main {
		Scanner stdIn = new Scanner(System.in);
		makePrimeList(100000000);
		int n = stdIn.nextInt();
		int count = 0;
		for(int i = 0; i < n; i++) {
			int x = stdIn.nextInt();
			if(x != 2 && x % 2 == 0) {
				continue;
			}
			if(!isntPrime[x]) {
				count++;
			}
		}
		System.out.println(count);
	} Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) makePrimeList(100000000) makePrimeList 100000000 int n = stdIn.nextInt(); n stdIn.nextInt() stdIn.nextInt stdIn int count = 0; count 0 for(int i = 0; i < n; i++) {
			int x = stdIn.nextInt();
			if(x != 2 && x % 2 == 0) {
				continue;
			}
			if(!isntPrime[x]) {
				count++;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			int x = stdIn.nextInt();
			if(x != 2 && x % 2 == 0) {
				continue;
			}
			if(!isntPrime[x]) {
				count++;
			}
		} {
			int x = stdIn.nextInt();
			if(x != 2 && x % 2 == 0) {
				continue;
			}
			if(!isntPrime[x]) {
				count++;
			}
		} int x = stdIn.nextInt(); x stdIn.nextInt() stdIn.nextInt stdIn if(x != 2 && x % 2 == 0) {
				continue;
			} x != 2 && x % 2 == 0 x != 2 x 2 x % 2 == 0 x % 2 x 2 0 {
				continue;
			} continue; if(!isntPrime[x]) {
				count++;
			} !isntPrime[x] isntPrime[x] isntPrime x {
				count++;
			} count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args public static void makePrimeList(int n) {
		isntPrime = new boolean[n+1];
		isntPrime[0] = isntPrime[1] = true;
		for(int i = 3; i < n; i+=2) {
			if(!isntPrime[i]) {
				for(int j = i + i; j < n; j += i){
					isntPrime[j] = true;
				}
			}
		}
	} makePrimeList {
		isntPrime = new boolean[n+1];
		isntPrime[0] = isntPrime[1] = true;
		for(int i = 3; i < n; i+=2) {
			if(!isntPrime[i]) {
				for(int j = i + i; j < n; j += i){
					isntPrime[j] = true;
				}
			}
		}
	} isntPrime = new boolean[n+1] isntPrime new boolean[n+1] n+1 n 1 isntPrime[0] = isntPrime[1] = true isntPrime[0] isntPrime 0 isntPrime[1] = true isntPrime[1] isntPrime 1 true for(int i = 3; i < n; i+=2) {
			if(!isntPrime[i]) {
				for(int j = i + i; j < n; j += i){
					isntPrime[j] = true;
				}
			}
		} int i = 3; int i = 3; i 3 i < n i n i+=2 i+=2 i 2 {
			if(!isntPrime[i]) {
				for(int j = i + i; j < n; j += i){
					isntPrime[j] = true;
				}
			}
		} {
			if(!isntPrime[i]) {
				for(int j = i + i; j < n; j += i){
					isntPrime[j] = true;
				}
			}
		} if(!isntPrime[i]) {
				for(int j = i + i; j < n; j += i){
					isntPrime[j] = true;
				}
			} !isntPrime[i] isntPrime[i] isntPrime i {
				for(int j = i + i; j < n; j += i){
					isntPrime[j] = true;
				}
			} for(int j = i + i; j < n; j += i){
					isntPrime[j] = true;
				} int j = i + i; int j = i + i; j i + i i i j < n j n j += i j += i j i {
					isntPrime[j] = true;
				} {
					isntPrime[j] = true;
				} isntPrime[j] = true isntPrime[j] isntPrime j true int n n public class Main {
	static String a;
	static boolean[] isntPrime;
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		makePrimeList(100000000);
		int n = stdIn.nextInt();
		int count = 0;
		for(int i = 0; i < n; i++) {
			int x = stdIn.nextInt();
			if(x != 2 && x % 2 == 0) {
				continue;
			}
			if(!isntPrime[x]) {
				count++;
			}
		}
		System.out.println(count);
	}
	
	
	public static void makePrimeList(int n) {
		isntPrime = new boolean[n+1];
		isntPrime[0] = isntPrime[1] = true;
		for(int i = 3; i < n; i+=2) {
			if(!isntPrime[i]) {
				for(int j = i + i; j < n; j += i){
					isntPrime[j] = true;
				}
			}
		}
	}
} public class Main {
	static String a;
	static boolean[] isntPrime;
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		makePrimeList(100000000);
		int n = stdIn.nextInt();
		int count = 0;
		for(int i = 0; i < n; i++) {
			int x = stdIn.nextInt();
			if(x != 2 && x % 2 == 0) {
				continue;
			}
			if(!isntPrime[x]) {
				count++;
			}
		}
		System.out.println(count);
	}
	
	
	public static void makePrimeList(int n) {
		isntPrime = new boolean[n+1];
		isntPrime[0] = isntPrime[1] = true;
		for(int i = 3; i < n; i+=2) {
			if(!isntPrime[i]) {
				for(int j = i + i; j < n; j += i){
					isntPrime[j] = true;
				}
			}
		}
	}
} Main
import java.io.*;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;
public class Main {
	static String a;
	static boolean[] isntPrime;
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		makePrimeList(100000000);
		int n = stdIn.nextInt();
		int count = 0;
		for(int i = 0; i < n; i++) {
			int x = stdIn.nextInt();
			if(x != 2 && x % 2 == 0) {
				continue;
			}
			if(!isntPrime[x]) {
				count++;
			}
		}
		System.out.println(count);
	}
	
	
	public static void makePrimeList(int n) {
		isntPrime = new boolean[n+1];
		isntPrime[0] = isntPrime[1] = true;
		for(int i = 3; i < n; i+=2) {
			if(!isntPrime[i]) {
				for(int j = i + i; j < n; j += i){
					isntPrime[j] = true;
				}
			}
		}
	}
}