/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner scanner = new Scanner(System.in);
		
		int n = Integer.parseInt(scanner.nextLine());
		
		long num;
		int result = 0;

		for (int i = 0; i < n; i++) {
			num = Long.parseLong(scanner.nextLine());
			
			if (isPrime(num)) {
				result++;
			}
			
		}
		
		
		
		System.out.println(result);
	}
	
	static boolean isPrime(long x) {
		boolean result = true;
		
		if (x == 2) {
			return result;
		}

		for (long j = 2; j <= Math.ceil(Math.sqrt(x)) ; j++) {
			
			if (x % j == 0) {
				result = false;
				
				break;
			}
		}
		
		
		return result;
	}
} import java.util.*; util.* java import java.lang.*; lang.* java import java.io.*; io.* java class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner scanner = new Scanner(System.in);
		
		int n = Integer.parseInt(scanner.nextLine());
		
		long num;
		int result = 0;

		for (int i = 0; i < n; i++) {
			num = Long.parseLong(scanner.nextLine());
			
			if (isPrime(num)) {
				result++;
			}
			
		}
		
		
		
		System.out.println(result);
	}
	
	static boolean isPrime(long x) {
		boolean result = true;
		
		if (x == 2) {
			return result;
		}

		for (long j = 2; j <= Math.ceil(Math.sqrt(x)) ; j++) {
			
			if (x % j == 0) {
				result = false;
				
				break;
			}
		}
		
		
		return result;
	}
} Main public static void main (String[] args) throws java.lang.Exception
	{
		Scanner scanner = new Scanner(System.in);
		
		int n = Integer.parseInt(scanner.nextLine());
		
		long num;
		int result = 0;

		for (int i = 0; i < n; i++) {
			num = Long.parseLong(scanner.nextLine());
			
			if (isPrime(num)) {
				result++;
			}
			
		}
		
		
		
		System.out.println(result);
	} main {
		Scanner scanner = new Scanner(System.in);
		
		int n = Integer.parseInt(scanner.nextLine());
		
		long num;
		int result = 0;

		for (int i = 0; i < n; i++) {
			num = Long.parseLong(scanner.nextLine());
			
			if (isPrime(num)) {
				result++;
			}
			
		}
		
		
		
		System.out.println(result);
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = Integer.parseInt(scanner.nextLine()); n Integer.parseInt(scanner.nextLine()) Integer.parseInt Integer scanner.nextLine() scanner.nextLine scanner long num; num int result = 0; result 0 for (int i = 0; i < n; i++) {
			num = Long.parseLong(scanner.nextLine());
			
			if (isPrime(num)) {
				result++;
			}
			
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			num = Long.parseLong(scanner.nextLine());
			
			if (isPrime(num)) {
				result++;
			}
			
		} {
			num = Long.parseLong(scanner.nextLine());
			
			if (isPrime(num)) {
				result++;
			}
			
		} num = Long.parseLong(scanner.nextLine()) num Long.parseLong(scanner.nextLine()) Long.parseLong Long scanner.nextLine() scanner.nextLine scanner if (isPrime(num)) {
				result++;
			} isPrime(num) isPrime num {
				result++;
			} result++ result System.out.println(result) System.out.println System.out System System.out result String[] args args static boolean isPrime(long x) {
		boolean result = true;
		
		if (x == 2) {
			return result;
		}

		for (long j = 2; j <= Math.ceil(Math.sqrt(x)) ; j++) {
			
			if (x % j == 0) {
				result = false;
				
				break;
			}
		}
		
		
		return result;
	} isPrime {
		boolean result = true;
		
		if (x == 2) {
			return result;
		}

		for (long j = 2; j <= Math.ceil(Math.sqrt(x)) ; j++) {
			
			if (x % j == 0) {
				result = false;
				
				break;
			}
		}
		
		
		return result;
	} boolean result = true; result true if (x == 2) {
			return result;
		} x == 2 x 2 {
			return result;
		} return result; result for (long j = 2; j <= Math.ceil(Math.sqrt(x)) ; j++) {
			
			if (x % j == 0) {
				result = false;
				
				break;
			}
		} long j = 2; long j = 2; j 2 j <= Math.ceil(Math.sqrt(x)) j Math.ceil(Math.sqrt(x)) Math.ceil Math Math.sqrt(x) Math.sqrt Math x j++ j++ j {
			
			if (x % j == 0) {
				result = false;
				
				break;
			}
		} {
			
			if (x % j == 0) {
				result = false;
				
				break;
			}
		} if (x % j == 0) {
				result = false;
				
				break;
			} x % j == 0 x % j x j 0 {
				result = false;
				
				break;
			} result = false result false break; return result; result long x x
/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner scanner = new Scanner(System.in);
		
		int n = Integer.parseInt(scanner.nextLine());
		
		long num;
		int result = 0;

		for (int i = 0; i < n; i++) {
			num = Long.parseLong(scanner.nextLine());
			
			if (isPrime(num)) {
				result++;
			}
			
		}
		
		
		
		System.out.println(result);
	}
	
	static boolean isPrime(long x) {
		boolean result = true;
		
		if (x == 2) {
			return result;
		}

		for (long j = 2; j <= Math.ceil(Math.sqrt(x)) ; j++) {
			
			if (x % j == 0) {
				result = false;
				
				break;
			}
		}
		
		
		return result;
	}
}
