import java.util.Scanner;

class Main {
	public static void main(String[] args) throws Exception {

		Scanner scanner = new Scanner(System.in);// ??\?????????????????????
		int count = scanner.nextInt();
		int flag = 0;
		
		for(int i = 0; i < count; i++){
			int num = scanner.nextInt();
			for(int j = (int) Math.sqrt(num); 1 < j; j--){
				if(j == 1){
					break;
				}
				if(num % j == 0){
					flag++;
					break;
				} 
			}
		}
		System.out.println(count - flag);
	}
} import java.util.Scanner; Scanner java.util class Main {
	public static void main(String[] args) throws Exception {

		Scanner scanner = new Scanner(System.in);// ??\?????????????????????
		int count = scanner.nextInt();
		int flag = 0;
		
		for(int i = 0; i < count; i++){
			int num = scanner.nextInt();
			for(int j = (int) Math.sqrt(num); 1 < j; j--){
				if(j == 1){
					break;
				}
				if(num % j == 0){
					flag++;
					break;
				} 
			}
		}
		System.out.println(count - flag);
	}
} Main public static void main(String[] args) throws Exception {

		Scanner scanner = new Scanner(System.in);// ??\?????????????????????
		int count = scanner.nextInt();
		int flag = 0;
		
		for(int i = 0; i < count; i++){
			int num = scanner.nextInt();
			for(int j = (int) Math.sqrt(num); 1 < j; j--){
				if(j == 1){
					break;
				}
				if(num % j == 0){
					flag++;
					break;
				} 
			}
		}
		System.out.println(count - flag);
	} main {

		Scanner scanner = new Scanner(System.in);// ??\?????????????????????
		int count = scanner.nextInt();
		int flag = 0;
		
		for(int i = 0; i < count; i++){
			int num = scanner.nextInt();
			for(int j = (int) Math.sqrt(num); 1 < j; j--){
				if(j == 1){
					break;
				}
				if(num % j == 0){
					flag++;
					break;
				} 
			}
		}
		System.out.println(count - flag);
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int count = scanner.nextInt(); count scanner.nextInt() scanner.nextInt scanner int flag = 0; flag 0 for(int i = 0; i < count; i++){
			int num = scanner.nextInt();
			for(int j = (int) Math.sqrt(num); 1 < j; j--){
				if(j == 1){
					break;
				}
				if(num % j == 0){
					flag++;
					break;
				} 
			}
		} int i = 0; int i = 0; i 0 i < count i count i++ i++ i {
			int num = scanner.nextInt();
			for(int j = (int) Math.sqrt(num); 1 < j; j--){
				if(j == 1){
					break;
				}
				if(num % j == 0){
					flag++;
					break;
				} 
			}
		} {
			int num = scanner.nextInt();
			for(int j = (int) Math.sqrt(num); 1 < j; j--){
				if(j == 1){
					break;
				}
				if(num % j == 0){
					flag++;
					break;
				} 
			}
		} int num = scanner.nextInt(); num scanner.nextInt() scanner.nextInt scanner for(int j = (int) Math.sqrt(num); 1 < j; j--){
				if(j == 1){
					break;
				}
				if(num % j == 0){
					flag++;
					break;
				} 
			} int j = (int) Math.sqrt(num); int j = (int) Math.sqrt(num); j (int) Math.sqrt(num) Math.sqrt Math num 1 < j 1 j j-- j-- j {
				if(j == 1){
					break;
				}
				if(num % j == 0){
					flag++;
					break;
				} 
			} {
				if(j == 1){
					break;
				}
				if(num % j == 0){
					flag++;
					break;
				} 
			} if(j == 1){
					break;
				} j == 1 j 1 {
					break;
				} break; if(num % j == 0){
					flag++;
					break;
				} num % j == 0 num % j num j 0 {
					flag++;
					break;
				} flag++ flag break; System.out.println(count - flag) System.out.println System.out System System.out count - flag count flag String[] args args
import java.util.Scanner;

class Main {
	public static void main(String[] args) throws Exception {

		Scanner scanner = new Scanner(System.in);// ??\?????????????????????
		int count = scanner.nextInt();
		int flag = 0;
		
		for(int i = 0; i < count; i++){
			int num = scanner.nextInt();
			for(int j = (int) Math.sqrt(num); 1 < j; j--){
				if(j == 1){
					break;
				}
				if(num % j == 0){
					flag++;
					break;
				} 
			}
		}
		System.out.println(count - flag);
	}
}