import java.util.Scanner;
public class Main {
	public static void main(String[] arg){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int c = 0;
		
		for(int i=0; i < n; i++){
			if(PNcheck(sc.nextInt())) c++;
		}
		System.out.println(c);
	}
	
	static boolean PNcheck(int n){
		if(n == 2) return true;
		if((n % 2) == 0) return false;
		
		for(int i=3; i*i <= n; i = i+2){
			if((n % i) == 0) return false;
		}
		return true;
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] arg){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int c = 0;
		
		for(int i=0; i < n; i++){
			if(PNcheck(sc.nextInt())) c++;
		}
		System.out.println(c);
	}
	
	static boolean PNcheck(int n){
		if(n == 2) return true;
		if((n % 2) == 0) return false;
		
		for(int i=3; i*i <= n; i = i+2){
			if((n % i) == 0) return false;
		}
		return true;
	}
} Main public static void main(String[] arg){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int c = 0;
		
		for(int i=0; i < n; i++){
			if(PNcheck(sc.nextInt())) c++;
		}
		System.out.println(c);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int c = 0;
		
		for(int i=0; i < n; i++){
			if(PNcheck(sc.nextInt())) c++;
		}
		System.out.println(c);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int c = 0; c 0 for(int i=0; i < n; i++){
			if(PNcheck(sc.nextInt())) c++;
		} int i=0; int i=0; i 0 i < n i n i++ i++ i {
			if(PNcheck(sc.nextInt())) c++;
		} {
			if(PNcheck(sc.nextInt())) c++;
		} if(PNcheck(sc.nextInt())) c++; PNcheck(sc.nextInt()) PNcheck sc.nextInt() sc.nextInt sc c++ c System.out.println(c) System.out.println System.out System System.out c String[] arg arg static boolean PNcheck(int n){
		if(n == 2) return true;
		if((n % 2) == 0) return false;
		
		for(int i=3; i*i <= n; i = i+2){
			if((n % i) == 0) return false;
		}
		return true;
	} PNcheck {
		if(n == 2) return true;
		if((n % 2) == 0) return false;
		
		for(int i=3; i*i <= n; i = i+2){
			if((n % i) == 0) return false;
		}
		return true;
	} if(n == 2) return true; n == 2 n 2 return true; true if((n % 2) == 0) return false; (n % 2) == 0 (n % 2) n 2 0 return false; false for(int i=3; i*i <= n; i = i+2){
			if((n % i) == 0) return false;
		} int i=3; int i=3; i 3 i*i <= n i*i i i n i = i+2 i = i+2 i i+2 i 2 {
			if((n % i) == 0) return false;
		} {
			if((n % i) == 0) return false;
		} if((n % i) == 0) return false; (n % i) == 0 (n % i) n i 0 return false; false return true; true int n n public class Main {
	public static void main(String[] arg){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int c = 0;
		
		for(int i=0; i < n; i++){
			if(PNcheck(sc.nextInt())) c++;
		}
		System.out.println(c);
	}
	
	static boolean PNcheck(int n){
		if(n == 2) return true;
		if((n % 2) == 0) return false;
		
		for(int i=3; i*i <= n; i = i+2){
			if((n % i) == 0) return false;
		}
		return true;
	}
} public class Main {
	public static void main(String[] arg){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int c = 0;
		
		for(int i=0; i < n; i++){
			if(PNcheck(sc.nextInt())) c++;
		}
		System.out.println(c);
	}
	
	static boolean PNcheck(int n){
		if(n == 2) return true;
		if((n % 2) == 0) return false;
		
		for(int i=3; i*i <= n; i = i+2){
			if((n % i) == 0) return false;
		}
		return true;
	}
} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] arg){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int c = 0;
		
		for(int i=0; i < n; i++){
			if(PNcheck(sc.nextInt())) c++;
		}
		System.out.println(c);
	}
	
	static boolean PNcheck(int n){
		if(n == 2) return true;
		if((n % 2) == 0) return false;
		
		for(int i=3; i*i <= n; i = i+2){
			if((n % i) == 0) return false;
		}
		return true;
	}
}