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

class Main{

	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[] x = new int[n];
		int count = 0;

		for(int i = 0; i < n; i++){
			x[i] = Integer.parseInt(br.readLine());
		}

		for(int i = 0; i < n; i++){
			
			if(isPrime(x[i])){
				count++;
			}

		}

		System.out.println(count);

	}

	static boolean isPrime(int x){

		if(x == 2){
			return true;
		}

		if(x < 2 || (x % 2) == 0){
			return false;
		}

		int i = 3;

		while(i <= Math.sqrt(x)){

			if((x % i) == 0){
				return false;
			}

			i += 2;

		}

		return true;

	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.IOException; IOException java.io class Main{

	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[] x = new int[n];
		int count = 0;

		for(int i = 0; i < n; i++){
			x[i] = Integer.parseInt(br.readLine());
		}

		for(int i = 0; i < n; i++){
			
			if(isPrime(x[i])){
				count++;
			}

		}

		System.out.println(count);

	}

	static boolean isPrime(int x){

		if(x == 2){
			return true;
		}

		if(x < 2 || (x % 2) == 0){
			return false;
		}

		int i = 3;

		while(i <= Math.sqrt(x)){

			if((x % i) == 0){
				return false;
			}

			i += 2;

		}

		return true;

	}

} Main public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[] x = new int[n];
		int count = 0;

		for(int i = 0; i < n; i++){
			x[i] = Integer.parseInt(br.readLine());
		}

		for(int i = 0; i < n; i++){
			
			if(isPrime(x[i])){
				count++;
			}

		}

		System.out.println(count);

	} main {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[] x = new int[n];
		int count = 0;

		for(int i = 0; i < n; i++){
			x[i] = Integer.parseInt(br.readLine());
		}

		for(int i = 0; i < n; i++){
			
			if(isPrime(x[i])){
				count++;
			}

		}

		System.out.println(count);

	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int[] x = new int[n]; x new int[n] n int count = 0; count 0 for(int i = 0; i < n; i++){
			x[i] = Integer.parseInt(br.readLine());
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			x[i] = Integer.parseInt(br.readLine());
		} {
			x[i] = Integer.parseInt(br.readLine());
		} x[i] = Integer.parseInt(br.readLine()) x[i] x i Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br for(int i = 0; i < n; i++){
			
			if(isPrime(x[i])){
				count++;
			}

		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			
			if(isPrime(x[i])){
				count++;
			}

		} {
			
			if(isPrime(x[i])){
				count++;
			}

		} if(isPrime(x[i])){
				count++;
			} isPrime(x[i]) isPrime x[i] x i {
				count++;
			} count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args static boolean isPrime(int x){

		if(x == 2){
			return true;
		}

		if(x < 2 || (x % 2) == 0){
			return false;
		}

		int i = 3;

		while(i <= Math.sqrt(x)){

			if((x % i) == 0){
				return false;
			}

			i += 2;

		}

		return true;

	} isPrime {

		if(x == 2){
			return true;
		}

		if(x < 2 || (x % 2) == 0){
			return false;
		}

		int i = 3;

		while(i <= Math.sqrt(x)){

			if((x % i) == 0){
				return false;
			}

			i += 2;

		}

		return true;

	} if(x == 2){
			return true;
		} 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 += 2;

		} i <= Math.sqrt(x) i Math.sqrt(x) Math.sqrt Math x {

			if((x % i) == 0){
				return false;
			}

			i += 2;

		} if((x % i) == 0){
				return false;
			} (x % i) == 0 (x % i) x i 0 {
				return false;
			} return false; false i += 2 i 2 return true; true int x x
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

class Main{

	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[] x = new int[n];
		int count = 0;

		for(int i = 0; i < n; i++){
			x[i] = Integer.parseInt(br.readLine());
		}

		for(int i = 0; i < n; i++){
			
			if(isPrime(x[i])){
				count++;
			}

		}

		System.out.println(count);

	}

	static boolean isPrime(int x){

		if(x == 2){
			return true;
		}

		if(x < 2 || (x % 2) == 0){
			return false;
		}

		int i = 3;

		while(i <= Math.sqrt(x)){

			if((x % i) == 0){
				return false;
			}

			i += 2;

		}

		return true;

	}

}