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

class Main {

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

		StringBuilder buider = new StringBuilder();

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String n = br.readLine();

		String nums;

		int count=0;
		for(int i=0; i<Integer.parseInt(n); i++){
			 nums = br.readLine();
			if(new BigInteger(nums).isProbablePrime(3)){
				count++;
			}
		}

		System.out.println(count);

	}

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

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

		StringBuilder buider = new StringBuilder();

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String n = br.readLine();

		String nums;

		int count=0;
		for(int i=0; i<Integer.parseInt(n); i++){
			 nums = br.readLine();
			if(new BigInteger(nums).isProbablePrime(3)){
				count++;
			}
		}

		System.out.println(count);

	}

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

		StringBuilder buider = new StringBuilder();

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String n = br.readLine();

		String nums;

		int count=0;
		for(int i=0; i<Integer.parseInt(n); i++){
			 nums = br.readLine();
			if(new BigInteger(nums).isProbablePrime(3)){
				count++;
			}
		}

		System.out.println(count);

	} main {

		StringBuilder buider = new StringBuilder();

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String n = br.readLine();

		String nums;

		int count=0;
		for(int i=0; i<Integer.parseInt(n); i++){
			 nums = br.readLine();
			if(new BigInteger(nums).isProbablePrime(3)){
				count++;
			}
		}

		System.out.println(count);

	} StringBuilder buider = new StringBuilder(); buider new StringBuilder() BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String n = br.readLine(); n br.readLine() br.readLine br String nums; nums int count=0; count 0 for(int i=0; i<Integer.parseInt(n); i++){
			 nums = br.readLine();
			if(new BigInteger(nums).isProbablePrime(3)){
				count++;
			}
		} int i=0; int i=0; i 0 i<Integer.parseInt(n) i Integer.parseInt(n) Integer.parseInt Integer n i++ i++ i {
			 nums = br.readLine();
			if(new BigInteger(nums).isProbablePrime(3)){
				count++;
			}
		} {
			 nums = br.readLine();
			if(new BigInteger(nums).isProbablePrime(3)){
				count++;
			}
		} nums = br.readLine() nums br.readLine() br.readLine br if(new BigInteger(nums).isProbablePrime(3)){
				count++;
			} new BigInteger(nums).isProbablePrime(3) new BigInteger(nums).isProbablePrime new BigInteger(nums) 3 {
				count++;
			} count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;

class Main {

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

		StringBuilder buider = new StringBuilder();

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String n = br.readLine();

		String nums;

		int count=0;
		for(int i=0; i<Integer.parseInt(n); i++){
			 nums = br.readLine();
			if(new BigInteger(nums).isProbablePrime(3)){
				count++;
			}
		}

		System.out.println(count);

	}

}