import java.util.Scanner;
class Main {
   public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int input = scan.nextInt();
		int[] num = new int[input];
		boolean t;
		int count = 0;
		
		for(int i = 0; i < input; i++){
			num[i] = scan.nextInt();
			
			if(isPrime(num[i])) {
				count++;
			}
		}
		
		System.out.println(count);
	}
	
	static boolean isPrime(int x){
		if(x == 2) 
			return true;
		
		if(x < 2 || (x % 2) == 0) 
			return false;
		
		for(int i = 3; i <= Math.sqrt(x); i += 2){
			if(x % i == 0){
				return false;
			}
		}
		return true;
	}
} import java.util.Scanner; Scanner java.util class Main {
   public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int input = scan.nextInt();
		int[] num = new int[input];
		boolean t;
		int count = 0;
		
		for(int i = 0; i < input; i++){
			num[i] = scan.nextInt();
			
			if(isPrime(num[i])) {
				count++;
			}
		}
		
		System.out.println(count);
	}
	
	static boolean isPrime(int x){
		if(x == 2) 
			return true;
		
		if(x < 2 || (x % 2) == 0) 
			return false;
		
		for(int i = 3; i <= Math.sqrt(x); i += 2){
			if(x % i == 0){
				return false;
			}
		}
		return true;
	}
} Main public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int input = scan.nextInt();
		int[] num = new int[input];
		boolean t;
		int count = 0;
		
		for(int i = 0; i < input; i++){
			num[i] = scan.nextInt();
			
			if(isPrime(num[i])) {
				count++;
			}
		}
		
		System.out.println(count);
	} main {
		Scanner scan = new Scanner(System.in);
		int input = scan.nextInt();
		int[] num = new int[input];
		boolean t;
		int count = 0;
		
		for(int i = 0; i < input; i++){
			num[i] = scan.nextInt();
			
			if(isPrime(num[i])) {
				count++;
			}
		}
		
		System.out.println(count);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int input = scan.nextInt(); input scan.nextInt() scan.nextInt scan int[] num = new int[input]; num new int[input] input boolean t; t int count = 0; count 0 for(int i = 0; i < input; i++){
			num[i] = scan.nextInt();
			
			if(isPrime(num[i])) {
				count++;
			}
		} int i = 0; int i = 0; i 0 i < input i input i++ i++ i {
			num[i] = scan.nextInt();
			
			if(isPrime(num[i])) {
				count++;
			}
		} {
			num[i] = scan.nextInt();
			
			if(isPrime(num[i])) {
				count++;
			}
		} num[i] = scan.nextInt() num[i] num i scan.nextInt() scan.nextInt scan if(isPrime(num[i])) {
				count++;
			} isPrime(num[i]) isPrime num[i] num i {
				count++;
			} count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args static boolean isPrime(int x){
		if(x == 2) 
			return true;
		
		if(x < 2 || (x % 2) == 0) 
			return false;
		
		for(int i = 3; i <= Math.sqrt(x); i += 2){
			if(x % i == 0){
				return false;
			}
		}
		return true;
	} isPrime {
		if(x == 2) 
			return true;
		
		if(x < 2 || (x % 2) == 0) 
			return false;
		
		for(int i = 3; i <= Math.sqrt(x); i += 2){
			if(x % i == 0){
				return false;
			}
		}
		return true;
	} if(x == 2) 
			return true; x == 2 x 2 return true; true if(x < 2 || (x % 2) == 0) 
			return false; x < 2 || (x % 2) == 0 x < 2 x 2 (x % 2) == 0 (x % 2) x 2 0 return false; false for(int i = 3; i <= Math.sqrt(x); i += 2){
			if(x % i == 0){
				return false;
			}
		} int i = 3; int i = 3; i 3 i <= Math.sqrt(x) i Math.sqrt(x) Math.sqrt Math x i += 2 i += 2 i 2 {
			if(x % i == 0){
				return false;
			}
		} {
			if(x % i == 0){
				return false;
			}
		} if(x % i == 0){
				return false;
			} x % i == 0 x % i x i 0 {
				return false;
			} return false; false return true; true int x x
import java.util.Scanner;
class Main {
   public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int input = scan.nextInt();
		int[] num = new int[input];
		boolean t;
		int count = 0;
		
		for(int i = 0; i < input; i++){
			num[i] = scan.nextInt();
			
			if(isPrime(num[i])) {
				count++;
			}
		}
		
		System.out.println(count);
	}
	
	static boolean isPrime(int x){
		if(x == 2) 
			return true;
		
		if(x < 2 || (x % 2) == 0) 
			return false;
		
		for(int i = 3; i <= Math.sqrt(x); i += 2){
			if(x % i == 0){
				return false;
			}
		}
		return true;
	}
}