import java.util.Scanner;

public class Main {
	static int MAX_COUNT= 100000000;
	public static void main(String[] args){

		boolean[] isPrimeNumber = createIsPrimeNumber();
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int count = 0;
		for(int i = 0; i <N; i++){
			int temp= sc.nextInt();
			if(isPrimeNumber[temp - 1]){
				count++;
			}
		}
		sc.close();
		System.out.println(count);
	}
	
	public static boolean[] createIsPrimeNumber(){
		boolean[] isPrimeNumber = new boolean[MAX_COUNT];
		for(int i = 0; i <MAX_COUNT; i++){
			isPrimeNumber[i] = true;
		}
		isPrimeNumber[0] = false;
		for(int i = 2; i < MAX_COUNT; i++){
			if(isPrimeNumber[i - 1]){
				int count = 2;
				while(true){
					if((i * count - 1) >= MAX_COUNT ){
						break;
					}
					isPrimeNumber[i * count - 1] = false;
					count++;
				}
			}
		}
		return isPrimeNumber;
	}
} import java.util.Scanner; Scanner java.util public class Main {
	static int MAX_COUNT= 100000000;
	public static void main(String[] args){

		boolean[] isPrimeNumber = createIsPrimeNumber();
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int count = 0;
		for(int i = 0; i <N; i++){
			int temp= sc.nextInt();
			if(isPrimeNumber[temp - 1]){
				count++;
			}
		}
		sc.close();
		System.out.println(count);
	}
	
	public static boolean[] createIsPrimeNumber(){
		boolean[] isPrimeNumber = new boolean[MAX_COUNT];
		for(int i = 0; i <MAX_COUNT; i++){
			isPrimeNumber[i] = true;
		}
		isPrimeNumber[0] = false;
		for(int i = 2; i < MAX_COUNT; i++){
			if(isPrimeNumber[i - 1]){
				int count = 2;
				while(true){
					if((i * count - 1) >= MAX_COUNT ){
						break;
					}
					isPrimeNumber[i * count - 1] = false;
					count++;
				}
			}
		}
		return isPrimeNumber;
	}
} Main static int MAX_COUNT= 100000000; MAX_COUNT 100000000 public static void main(String[] args){

		boolean[] isPrimeNumber = createIsPrimeNumber();
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int count = 0;
		for(int i = 0; i <N; i++){
			int temp= sc.nextInt();
			if(isPrimeNumber[temp - 1]){
				count++;
			}
		}
		sc.close();
		System.out.println(count);
	} main {

		boolean[] isPrimeNumber = createIsPrimeNumber();
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int count = 0;
		for(int i = 0; i <N; i++){
			int temp= sc.nextInt();
			if(isPrimeNumber[temp - 1]){
				count++;
			}
		}
		sc.close();
		System.out.println(count);
	} boolean[] isPrimeNumber = createIsPrimeNumber(); isPrimeNumber createIsPrimeNumber() createIsPrimeNumber Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int count = 0; count 0 for(int i = 0; i <N; i++){
			int temp= sc.nextInt();
			if(isPrimeNumber[temp - 1]){
				count++;
			}
		} int i = 0; int i = 0; i 0 i <N i N i++ i++ i {
			int temp= sc.nextInt();
			if(isPrimeNumber[temp - 1]){
				count++;
			}
		} {
			int temp= sc.nextInt();
			if(isPrimeNumber[temp - 1]){
				count++;
			}
		} int temp= sc.nextInt(); temp sc.nextInt() sc.nextInt sc if(isPrimeNumber[temp - 1]){
				count++;
			} isPrimeNumber[temp - 1] isPrimeNumber temp - 1 temp 1 {
				count++;
			} count++ count sc.close() sc.close sc System.out.println(count) System.out.println System.out System System.out count String[] args args public static boolean[] createIsPrimeNumber(){
		boolean[] isPrimeNumber = new boolean[MAX_COUNT];
		for(int i = 0; i <MAX_COUNT; i++){
			isPrimeNumber[i] = true;
		}
		isPrimeNumber[0] = false;
		for(int i = 2; i < MAX_COUNT; i++){
			if(isPrimeNumber[i - 1]){
				int count = 2;
				while(true){
					if((i * count - 1) >= MAX_COUNT ){
						break;
					}
					isPrimeNumber[i * count - 1] = false;
					count++;
				}
			}
		}
		return isPrimeNumber;
	} createIsPrimeNumber {
		boolean[] isPrimeNumber = new boolean[MAX_COUNT];
		for(int i = 0; i <MAX_COUNT; i++){
			isPrimeNumber[i] = true;
		}
		isPrimeNumber[0] = false;
		for(int i = 2; i < MAX_COUNT; i++){
			if(isPrimeNumber[i - 1]){
				int count = 2;
				while(true){
					if((i * count - 1) >= MAX_COUNT ){
						break;
					}
					isPrimeNumber[i * count - 1] = false;
					count++;
				}
			}
		}
		return isPrimeNumber;
	} boolean[] isPrimeNumber = new boolean[MAX_COUNT]; isPrimeNumber new boolean[MAX_COUNT] MAX_COUNT for(int i = 0; i <MAX_COUNT; i++){
			isPrimeNumber[i] = true;
		} int i = 0; int i = 0; i 0 i <MAX_COUNT i MAX_COUNT i++ i++ i {
			isPrimeNumber[i] = true;
		} {
			isPrimeNumber[i] = true;
		} isPrimeNumber[i] = true isPrimeNumber[i] isPrimeNumber i true isPrimeNumber[0] = false isPrimeNumber[0] isPrimeNumber 0 false for(int i = 2; i < MAX_COUNT; i++){
			if(isPrimeNumber[i - 1]){
				int count = 2;
				while(true){
					if((i * count - 1) >= MAX_COUNT ){
						break;
					}
					isPrimeNumber[i * count - 1] = false;
					count++;
				}
			}
		} int i = 2; int i = 2; i 2 i < MAX_COUNT i MAX_COUNT i++ i++ i {
			if(isPrimeNumber[i - 1]){
				int count = 2;
				while(true){
					if((i * count - 1) >= MAX_COUNT ){
						break;
					}
					isPrimeNumber[i * count - 1] = false;
					count++;
				}
			}
		} {
			if(isPrimeNumber[i - 1]){
				int count = 2;
				while(true){
					if((i * count - 1) >= MAX_COUNT ){
						break;
					}
					isPrimeNumber[i * count - 1] = false;
					count++;
				}
			}
		} if(isPrimeNumber[i - 1]){
				int count = 2;
				while(true){
					if((i * count - 1) >= MAX_COUNT ){
						break;
					}
					isPrimeNumber[i * count - 1] = false;
					count++;
				}
			} isPrimeNumber[i - 1] isPrimeNumber i - 1 i 1 {
				int count = 2;
				while(true){
					if((i * count - 1) >= MAX_COUNT ){
						break;
					}
					isPrimeNumber[i * count - 1] = false;
					count++;
				}
			} int count = 2; count 2 while(true){
					if((i * count - 1) >= MAX_COUNT ){
						break;
					}
					isPrimeNumber[i * count - 1] = false;
					count++;
				} true {
					if((i * count - 1) >= MAX_COUNT ){
						break;
					}
					isPrimeNumber[i * count - 1] = false;
					count++;
				} if((i * count - 1) >= MAX_COUNT ){
						break;
					} (i * count - 1) >= MAX_COUNT (i * count - 1) i * count i count 1 MAX_COUNT {
						break;
					} break; isPrimeNumber[i * count - 1] = false isPrimeNumber[i * count - 1] isPrimeNumber i * count - 1 i * count i count 1 false count++ count return isPrimeNumber; isPrimeNumber public class Main {
	static int MAX_COUNT= 100000000;
	public static void main(String[] args){

		boolean[] isPrimeNumber = createIsPrimeNumber();
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int count = 0;
		for(int i = 0; i <N; i++){
			int temp= sc.nextInt();
			if(isPrimeNumber[temp - 1]){
				count++;
			}
		}
		sc.close();
		System.out.println(count);
	}
	
	public static boolean[] createIsPrimeNumber(){
		boolean[] isPrimeNumber = new boolean[MAX_COUNT];
		for(int i = 0; i <MAX_COUNT; i++){
			isPrimeNumber[i] = true;
		}
		isPrimeNumber[0] = false;
		for(int i = 2; i < MAX_COUNT; i++){
			if(isPrimeNumber[i - 1]){
				int count = 2;
				while(true){
					if((i * count - 1) >= MAX_COUNT ){
						break;
					}
					isPrimeNumber[i * count - 1] = false;
					count++;
				}
			}
		}
		return isPrimeNumber;
	}
} public class Main {
	static int MAX_COUNT= 100000000;
	public static void main(String[] args){

		boolean[] isPrimeNumber = createIsPrimeNumber();
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int count = 0;
		for(int i = 0; i <N; i++){
			int temp= sc.nextInt();
			if(isPrimeNumber[temp - 1]){
				count++;
			}
		}
		sc.close();
		System.out.println(count);
	}
	
	public static boolean[] createIsPrimeNumber(){
		boolean[] isPrimeNumber = new boolean[MAX_COUNT];
		for(int i = 0; i <MAX_COUNT; i++){
			isPrimeNumber[i] = true;
		}
		isPrimeNumber[0] = false;
		for(int i = 2; i < MAX_COUNT; i++){
			if(isPrimeNumber[i - 1]){
				int count = 2;
				while(true){
					if((i * count - 1) >= MAX_COUNT ){
						break;
					}
					isPrimeNumber[i * count - 1] = false;
					count++;
				}
			}
		}
		return isPrimeNumber;
	}
} Main
import java.util.Scanner;

public class Main {
	static int MAX_COUNT= 100000000;
	public static void main(String[] args){

		boolean[] isPrimeNumber = createIsPrimeNumber();
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int count = 0;
		for(int i = 0; i <N; i++){
			int temp= sc.nextInt();
			if(isPrimeNumber[temp - 1]){
				count++;
			}
		}
		sc.close();
		System.out.println(count);
	}
	
	public static boolean[] createIsPrimeNumber(){
		boolean[] isPrimeNumber = new boolean[MAX_COUNT];
		for(int i = 0; i <MAX_COUNT; i++){
			isPrimeNumber[i] = true;
		}
		isPrimeNumber[0] = false;
		for(int i = 2; i < MAX_COUNT; i++){
			if(isPrimeNumber[i - 1]){
				int count = 2;
				while(true){
					if((i * count - 1) >= MAX_COUNT ){
						break;
					}
					isPrimeNumber[i * count - 1] = false;
					count++;
				}
			}
		}
		return isPrimeNumber;
	}
}