import java.util.Scanner;

public class Main {
	public static void main(String args[]){
		run();
	}

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

	static boolean isPrime(int x){
		if(x == 2){
			return true;
		}else if(x < 2 || x % 2 == 0){
			return false;
		}
		int i = 3;
		while(i <= Math.sqrt(x)){
			if(x % i == 0){
				return false;
			}
			i= i + 2;
		}
		return true;
	}
	
	static void run(){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int x;
		int count;
		count = 0;
		boolean judge;
		for(int i = 0; i < n; i++){
			x = scan.nextInt();
			judge = isPrime(x);
			if(judge) count++;
			judge = false;
		}
		System.out.println(count);
	}
} Main public static void main(String args[]){
		run();
	} main {
		run();
	} run() run String args[] args static boolean isPrime(int x){
		if(x == 2){
			return true;
		}else if(x < 2 || x % 2 == 0){
			return false;
		}
		int i = 3;
		while(i <= Math.sqrt(x)){
			if(x % i == 0){
				return false;
			}
			i= i + 2;
		}
		return true;
	} isPrime {
		if(x == 2){
			return true;
		}else if(x < 2 || x % 2 == 0){
			return false;
		}
		int i = 3;
		while(i <= Math.sqrt(x)){
			if(x % i == 0){
				return false;
			}
			i= i + 2;
		}
		return true;
	} if(x == 2){
			return true;
		}else if(x < 2 || x % 2 == 0){
			return false;
		} x == 2 x 2 {
			return true;
		} return true; true if(x < 2 || x % 2 == 0){
			return false;
		} x < 2 || x % 2 == 0 x < 2 x 2 x % 2 == 0 x % 2 x 2 0 {
			return false;
		} return false; false int i = 3; i 3 while(i <= Math.sqrt(x)){
			if(x % i == 0){
				return false;
			}
			i= i + 2;
		} i <= Math.sqrt(x) i Math.sqrt(x) Math.sqrt Math x {
			if(x % i == 0){
				return false;
			}
			i= i + 2;
		} if(x % i == 0){
				return false;
			} x % i == 0 x % i x i 0 {
				return false;
			} return false; false i= i + 2 i i + 2 i 2 return true; true int x x static void run(){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int x;
		int count;
		count = 0;
		boolean judge;
		for(int i = 0; i < n; i++){
			x = scan.nextInt();
			judge = isPrime(x);
			if(judge) count++;
			judge = false;
		}
		System.out.println(count);
	} run {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int x;
		int count;
		count = 0;
		boolean judge;
		for(int i = 0; i < n; i++){
			x = scan.nextInt();
			judge = isPrime(x);
			if(judge) count++;
			judge = false;
		}
		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 x; x int count; count count = 0 count 0 boolean judge; judge for(int i = 0; i < n; i++){
			x = scan.nextInt();
			judge = isPrime(x);
			if(judge) count++;
			judge = false;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			x = scan.nextInt();
			judge = isPrime(x);
			if(judge) count++;
			judge = false;
		} {
			x = scan.nextInt();
			judge = isPrime(x);
			if(judge) count++;
			judge = false;
		} x = scan.nextInt() x scan.nextInt() scan.nextInt scan judge = isPrime(x) judge isPrime(x) isPrime x if(judge) count++; judge count++ count judge = false judge false System.out.println(count) System.out.println System.out System System.out count public class Main {
	public static void main(String args[]){
		run();
	}

	static boolean isPrime(int x){
		if(x == 2){
			return true;
		}else if(x < 2 || x % 2 == 0){
			return false;
		}
		int i = 3;
		while(i <= Math.sqrt(x)){
			if(x % i == 0){
				return false;
			}
			i= i + 2;
		}
		return true;
	}
	
	static void run(){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int x;
		int count;
		count = 0;
		boolean judge;
		for(int i = 0; i < n; i++){
			x = scan.nextInt();
			judge = isPrime(x);
			if(judge) count++;
			judge = false;
		}
		System.out.println(count);
	}
} public class Main {
	public static void main(String args[]){
		run();
	}

	static boolean isPrime(int x){
		if(x == 2){
			return true;
		}else if(x < 2 || x % 2 == 0){
			return false;
		}
		int i = 3;
		while(i <= Math.sqrt(x)){
			if(x % i == 0){
				return false;
			}
			i= i + 2;
		}
		return true;
	}
	
	static void run(){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int x;
		int count;
		count = 0;
		boolean judge;
		for(int i = 0; i < n; i++){
			x = scan.nextInt();
			judge = isPrime(x);
			if(judge) count++;
			judge = false;
		}
		System.out.println(count);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String args[]){
		run();
	}

	static boolean isPrime(int x){
		if(x == 2){
			return true;
		}else if(x < 2 || x % 2 == 0){
			return false;
		}
		int i = 3;
		while(i <= Math.sqrt(x)){
			if(x % i == 0){
				return false;
			}
			i= i + 2;
		}
		return true;
	}
	
	static void run(){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int x;
		int count;
		count = 0;
		boolean judge;
		for(int i = 0; i < n; i++){
			x = scan.nextInt();
			judge = isPrime(x);
			if(judge) count++;
			judge = false;
		}
		System.out.println(count);
	}
}