import java.io.IOException;
import java.util.Scanner;
class Main{
	public static void main(String[] args)throws NumberFormatException, IOException{
//		System.out.println(" ");
		Scanner scan = new Scanner(System.in);
		int times = scan.nextInt();
		int num[] =new int[times];
		int keisan = 0;
		int sosu = 0;
		boolean tf = true;
		for(int i=0;i<times;i++){
			num[i] = scan.nextInt();
		}

		for(int i=0;i<times;i++){
			tf = true;
			if(num[i] == 2 || num[i] % 2 == 0){
				tf = false;
			}
			int ii=3;
			while (ii <= Math.sqrt(num[i])){
				if(num[i] % ii == 0){
					tf = false;
				}
				ii += 2;
			}
			if (num[i] == 2){
				tf = true;
			}
			if(tf == true){
				sosu +=1;
			}
		}
		System.out.println(sosu);
	}
} import java.io.IOException; IOException java.io import java.util.Scanner; Scanner java.util class Main{
	public static void main(String[] args)throws NumberFormatException, IOException{
//		System.out.println(" ");
		Scanner scan = new Scanner(System.in);
		int times = scan.nextInt();
		int num[] =new int[times];
		int keisan = 0;
		int sosu = 0;
		boolean tf = true;
		for(int i=0;i<times;i++){
			num[i] = scan.nextInt();
		}

		for(int i=0;i<times;i++){
			tf = true;
			if(num[i] == 2 || num[i] % 2 == 0){
				tf = false;
			}
			int ii=3;
			while (ii <= Math.sqrt(num[i])){
				if(num[i] % ii == 0){
					tf = false;
				}
				ii += 2;
			}
			if (num[i] == 2){
				tf = true;
			}
			if(tf == true){
				sosu +=1;
			}
		}
		System.out.println(sosu);
	}
} Main public static void main(String[] args)throws NumberFormatException, IOException{
//		System.out.println(" ");
		Scanner scan = new Scanner(System.in);
		int times = scan.nextInt();
		int num[] =new int[times];
		int keisan = 0;
		int sosu = 0;
		boolean tf = true;
		for(int i=0;i<times;i++){
			num[i] = scan.nextInt();
		}

		for(int i=0;i<times;i++){
			tf = true;
			if(num[i] == 2 || num[i] % 2 == 0){
				tf = false;
			}
			int ii=3;
			while (ii <= Math.sqrt(num[i])){
				if(num[i] % ii == 0){
					tf = false;
				}
				ii += 2;
			}
			if (num[i] == 2){
				tf = true;
			}
			if(tf == true){
				sosu +=1;
			}
		}
		System.out.println(sosu);
	} main {
//		System.out.println(" ");
		Scanner scan = new Scanner(System.in);
		int times = scan.nextInt();
		int num[] =new int[times];
		int keisan = 0;
		int sosu = 0;
		boolean tf = true;
		for(int i=0;i<times;i++){
			num[i] = scan.nextInt();
		}

		for(int i=0;i<times;i++){
			tf = true;
			if(num[i] == 2 || num[i] % 2 == 0){
				tf = false;
			}
			int ii=3;
			while (ii <= Math.sqrt(num[i])){
				if(num[i] % ii == 0){
					tf = false;
				}
				ii += 2;
			}
			if (num[i] == 2){
				tf = true;
			}
			if(tf == true){
				sosu +=1;
			}
		}
		System.out.println(sosu);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int times = scan.nextInt(); times scan.nextInt() scan.nextInt scan int num[] =new int[times]; num new int[times] times int keisan = 0; keisan 0 int sosu = 0; sosu 0 boolean tf = true; tf true for(int i=0;i<times;i++){
			num[i] = scan.nextInt();
		} int i=0; int i=0; i 0 i<times i times i++ i++ i {
			num[i] = scan.nextInt();
		} {
			num[i] = scan.nextInt();
		} num[i] = scan.nextInt() num[i] num i scan.nextInt() scan.nextInt scan for(int i=0;i<times;i++){
			tf = true;
			if(num[i] == 2 || num[i] % 2 == 0){
				tf = false;
			}
			int ii=3;
			while (ii <= Math.sqrt(num[i])){
				if(num[i] % ii == 0){
					tf = false;
				}
				ii += 2;
			}
			if (num[i] == 2){
				tf = true;
			}
			if(tf == true){
				sosu +=1;
			}
		} int i=0; int i=0; i 0 i<times i times i++ i++ i {
			tf = true;
			if(num[i] == 2 || num[i] % 2 == 0){
				tf = false;
			}
			int ii=3;
			while (ii <= Math.sqrt(num[i])){
				if(num[i] % ii == 0){
					tf = false;
				}
				ii += 2;
			}
			if (num[i] == 2){
				tf = true;
			}
			if(tf == true){
				sosu +=1;
			}
		} {
			tf = true;
			if(num[i] == 2 || num[i] % 2 == 0){
				tf = false;
			}
			int ii=3;
			while (ii <= Math.sqrt(num[i])){
				if(num[i] % ii == 0){
					tf = false;
				}
				ii += 2;
			}
			if (num[i] == 2){
				tf = true;
			}
			if(tf == true){
				sosu +=1;
			}
		} tf = true tf true if(num[i] == 2 || num[i] % 2 == 0){
				tf = false;
			} num[i] == 2 || num[i] % 2 == 0 num[i] == 2 num[i] num i 2 num[i] % 2 == 0 num[i] % 2 num[i] num i 2 0 {
				tf = false;
			} tf = false tf false int ii=3; ii 3 while (ii <= Math.sqrt(num[i])){
				if(num[i] % ii == 0){
					tf = false;
				}
				ii += 2;
			} ii <= Math.sqrt(num[i]) ii Math.sqrt(num[i]) Math.sqrt Math num[i] num i {
				if(num[i] % ii == 0){
					tf = false;
				}
				ii += 2;
			} if(num[i] % ii == 0){
					tf = false;
				} num[i] % ii == 0 num[i] % ii num[i] num i ii 0 {
					tf = false;
				} tf = false tf false ii += 2 ii 2 if (num[i] == 2){
				tf = true;
			} num[i] == 2 num[i] num i 2 {
				tf = true;
			} tf = true tf true if(tf == true){
				sosu +=1;
			} tf == true tf true {
				sosu +=1;
			} sosu +=1 sosu 1 System.out.println(sosu) System.out.println System.out System System.out sosu String[] args args
import java.io.IOException;
import java.util.Scanner;
class Main{
	public static void main(String[] args)throws NumberFormatException, IOException{
//		System.out.println(" ");
		Scanner scan = new Scanner(System.in);
		int times = scan.nextInt();
		int num[] =new int[times];
		int keisan = 0;
		int sosu = 0;
		boolean tf = true;
		for(int i=0;i<times;i++){
			num[i] = scan.nextInt();
		}

		for(int i=0;i<times;i++){
			tf = true;
			if(num[i] == 2 || num[i] % 2 == 0){
				tf = false;
			}
			int ii=3;
			while (ii <= Math.sqrt(num[i])){
				if(num[i] % ii == 0){
					tf = false;
				}
				ii += 2;
			}
			if (num[i] == 2){
				tf = true;
			}
			if(tf == true){
				sosu +=1;
			}
		}
		System.out.println(sosu);
	}
}