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