import java.io.BufferedReader;
import java.io.InputStreamReader;


public class Main {
	private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	
	public static void main(String[] args) throws Exception {
		int n = Integer.parseInt(br.readLine());
		
		int count = 0;
		for(int i = 0; i < n; i++){
			int num = Integer.parseInt(br.readLine());
			if(num == searchMinDivisor(num)){
				count++;
			}
		}
		
		System.out.println(count);
	}
	
	public static long searchMinDivisor(long n){
		long p;
		boolean isSucceed = false;
		for(p = 2; p * p <= n; p++){
			if(n % p == 0){
				isSucceed = true;
				break;
			}
		}
		if(!isSucceed){
			p = n;
		}
		return p;
	}
}
 import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	
	public static void main(String[] args) throws Exception {
		int n = Integer.parseInt(br.readLine());
		
		int count = 0;
		for(int i = 0; i < n; i++){
			int num = Integer.parseInt(br.readLine());
			if(num == searchMinDivisor(num)){
				count++;
			}
		}
		
		System.out.println(count);
	}
	
	public static long searchMinDivisor(long n){
		long p;
		boolean isSucceed = false;
		for(p = 2; p * p <= n; p++){
			if(n % p == 0){
				isSucceed = true;
				break;
			}
		}
		if(!isSucceed){
			p = n;
		}
		return p;
	}
} Main private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) public static void main(String[] args) throws Exception {
		int n = Integer.parseInt(br.readLine());
		
		int count = 0;
		for(int i = 0; i < n; i++){
			int num = Integer.parseInt(br.readLine());
			if(num == searchMinDivisor(num)){
				count++;
			}
		}
		
		System.out.println(count);
	} main {
		int n = Integer.parseInt(br.readLine());
		
		int count = 0;
		for(int i = 0; i < n; i++){
			int num = Integer.parseInt(br.readLine());
			if(num == searchMinDivisor(num)){
				count++;
			}
		}
		
		System.out.println(count);
	} int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int count = 0; count 0 for(int i = 0; i < n; i++){
			int num = Integer.parseInt(br.readLine());
			if(num == searchMinDivisor(num)){
				count++;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			int num = Integer.parseInt(br.readLine());
			if(num == searchMinDivisor(num)){
				count++;
			}
		} {
			int num = Integer.parseInt(br.readLine());
			if(num == searchMinDivisor(num)){
				count++;
			}
		} int num = Integer.parseInt(br.readLine()); num Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br if(num == searchMinDivisor(num)){
				count++;
			} num == searchMinDivisor(num) num searchMinDivisor(num) searchMinDivisor num {
				count++;
			} count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args public static long searchMinDivisor(long n){
		long p;
		boolean isSucceed = false;
		for(p = 2; p * p <= n; p++){
			if(n % p == 0){
				isSucceed = true;
				break;
			}
		}
		if(!isSucceed){
			p = n;
		}
		return p;
	} searchMinDivisor {
		long p;
		boolean isSucceed = false;
		for(p = 2; p * p <= n; p++){
			if(n % p == 0){
				isSucceed = true;
				break;
			}
		}
		if(!isSucceed){
			p = n;
		}
		return p;
	} long p; p boolean isSucceed = false; isSucceed false for(p = 2; p * p <= n; p++){
			if(n % p == 0){
				isSucceed = true;
				break;
			}
		} p = 2; p = 2 p 2 p * p <= n p * p p p n p++ p++ p {
			if(n % p == 0){
				isSucceed = true;
				break;
			}
		} {
			if(n % p == 0){
				isSucceed = true;
				break;
			}
		} if(n % p == 0){
				isSucceed = true;
				break;
			} n % p == 0 n % p n p 0 {
				isSucceed = true;
				break;
			} isSucceed = true isSucceed true break; if(!isSucceed){
			p = n;
		} !isSucceed isSucceed {
			p = n;
		} p = n p n return p; p long n n public class Main {
	private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	
	public static void main(String[] args) throws Exception {
		int n = Integer.parseInt(br.readLine());
		
		int count = 0;
		for(int i = 0; i < n; i++){
			int num = Integer.parseInt(br.readLine());
			if(num == searchMinDivisor(num)){
				count++;
			}
		}
		
		System.out.println(count);
	}
	
	public static long searchMinDivisor(long n){
		long p;
		boolean isSucceed = false;
		for(p = 2; p * p <= n; p++){
			if(n % p == 0){
				isSucceed = true;
				break;
			}
		}
		if(!isSucceed){
			p = n;
		}
		return p;
	}
} public class Main {
	private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	
	public static void main(String[] args) throws Exception {
		int n = Integer.parseInt(br.readLine());
		
		int count = 0;
		for(int i = 0; i < n; i++){
			int num = Integer.parseInt(br.readLine());
			if(num == searchMinDivisor(num)){
				count++;
			}
		}
		
		System.out.println(count);
	}
	
	public static long searchMinDivisor(long n){
		long p;
		boolean isSucceed = false;
		for(p = 2; p * p <= n; p++){
			if(n % p == 0){
				isSucceed = true;
				break;
			}
		}
		if(!isSucceed){
			p = n;
		}
		return p;
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;


public class Main {
	private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	
	public static void main(String[] args) throws Exception {
		int n = Integer.parseInt(br.readLine());
		
		int count = 0;
		for(int i = 0; i < n; i++){
			int num = Integer.parseInt(br.readLine());
			if(num == searchMinDivisor(num)){
				count++;
			}
		}
		
		System.out.println(count);
	}
	
	public static long searchMinDivisor(long n){
		long p;
		boolean isSucceed = false;
		for(p = 2; p * p <= n; p++){
			if(n % p == 0){
				isSucceed = true;
				break;
			}
		}
		if(!isSucceed){
			p = n;
		}
		return p;
	}
}

