import java.util.Scanner;

class Main
{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		
		int[] n = new int[10000];
		
		int N = scan.nextInt();
		
		int kai = N;
		int x = 0;
		
		for(int i=0; i<N; i++){
			n[i] = scan.nextInt();
		}
		
		for(int i=0; i<N; i++){
			if(n[i]%2==0 && n[i]!=2){
				kai--;
				x++;
				continue;
			}
			for(int q=2; q<=Math.sqrt(n[i]); q++){
				if(n[i]%q==0){
					kai--;
					break;
				}
			}
		}
		
		System.out.println(kai);
	}
} import java.util.Scanner; Scanner java.util class Main
{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		
		int[] n = new int[10000];
		
		int N = scan.nextInt();
		
		int kai = N;
		int x = 0;
		
		for(int i=0; i<N; i++){
			n[i] = scan.nextInt();
		}
		
		for(int i=0; i<N; i++){
			if(n[i]%2==0 && n[i]!=2){
				kai--;
				x++;
				continue;
			}
			for(int q=2; q<=Math.sqrt(n[i]); q++){
				if(n[i]%q==0){
					kai--;
					break;
				}
			}
		}
		
		System.out.println(kai);
	}
} Main public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		
		int[] n = new int[10000];
		
		int N = scan.nextInt();
		
		int kai = N;
		int x = 0;
		
		for(int i=0; i<N; i++){
			n[i] = scan.nextInt();
		}
		
		for(int i=0; i<N; i++){
			if(n[i]%2==0 && n[i]!=2){
				kai--;
				x++;
				continue;
			}
			for(int q=2; q<=Math.sqrt(n[i]); q++){
				if(n[i]%q==0){
					kai--;
					break;
				}
			}
		}
		
		System.out.println(kai);
	} main {
		Scanner scan = new Scanner(System.in);
		
		int[] n = new int[10000];
		
		int N = scan.nextInt();
		
		int kai = N;
		int x = 0;
		
		for(int i=0; i<N; i++){
			n[i] = scan.nextInt();
		}
		
		for(int i=0; i<N; i++){
			if(n[i]%2==0 && n[i]!=2){
				kai--;
				x++;
				continue;
			}
			for(int q=2; q<=Math.sqrt(n[i]); q++){
				if(n[i]%q==0){
					kai--;
					break;
				}
			}
		}
		
		System.out.println(kai);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int[] n = new int[10000]; n new int[10000] 10000 int N = scan.nextInt(); N scan.nextInt() scan.nextInt scan int kai = N; kai N int x = 0; x 0 for(int i=0; i<N; i++){
			n[i] = scan.nextInt();
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			n[i] = scan.nextInt();
		} {
			n[i] = scan.nextInt();
		} n[i] = scan.nextInt() n[i] n i scan.nextInt() scan.nextInt scan for(int i=0; i<N; i++){
			if(n[i]%2==0 && n[i]!=2){
				kai--;
				x++;
				continue;
			}
			for(int q=2; q<=Math.sqrt(n[i]); q++){
				if(n[i]%q==0){
					kai--;
					break;
				}
			}
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			if(n[i]%2==0 && n[i]!=2){
				kai--;
				x++;
				continue;
			}
			for(int q=2; q<=Math.sqrt(n[i]); q++){
				if(n[i]%q==0){
					kai--;
					break;
				}
			}
		} {
			if(n[i]%2==0 && n[i]!=2){
				kai--;
				x++;
				continue;
			}
			for(int q=2; q<=Math.sqrt(n[i]); q++){
				if(n[i]%q==0){
					kai--;
					break;
				}
			}
		} if(n[i]%2==0 && n[i]!=2){
				kai--;
				x++;
				continue;
			} n[i]%2==0 && n[i]!=2 n[i]%2==0 n[i]%2 n[i] n i 2 0 n[i]!=2 n[i] n i 2 {
				kai--;
				x++;
				continue;
			} kai-- kai x++ x continue; for(int q=2; q<=Math.sqrt(n[i]); q++){
				if(n[i]%q==0){
					kai--;
					break;
				}
			} int q=2; int q=2; q 2 q<=Math.sqrt(n[i]) q Math.sqrt(n[i]) Math.sqrt Math n[i] n i q++ q++ q {
				if(n[i]%q==0){
					kai--;
					break;
				}
			} {
				if(n[i]%q==0){
					kai--;
					break;
				}
			} if(n[i]%q==0){
					kai--;
					break;
				} n[i]%q==0 n[i]%q n[i] n i q 0 {
					kai--;
					break;
				} kai-- kai break; System.out.println(kai) System.out.println System.out System System.out kai String[] args args
import java.util.Scanner;

class Main
{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		
		int[] n = new int[10000];
		
		int N = scan.nextInt();
		
		int kai = N;
		int x = 0;
		
		for(int i=0; i<N; i++){
			n[i] = scan.nextInt();
		}
		
		for(int i=0; i<N; i++){
			if(n[i]%2==0 && n[i]!=2){
				kai--;
				x++;
				continue;
			}
			for(int q=2; q<=Math.sqrt(n[i]); q++){
				if(n[i]%q==0){
					kai--;
					break;
				}
			}
		}
		
		System.out.println(kai);
	}
}
