import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Date;

public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO ?????????????????????????????????????????????
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		PrimeNumberGenerator png = new PrimeNumberGenerator();
		int count = 0;

		for(int i = 0; i < n; i++){

			int m = Integer.parseInt(br.readLine());


			if(png.isPrime(m)){
					//System.out.println(i);
				count++;
			}


		}
		System.out.println(count);
	}

}

class PrimeNumberGenerator {
	private boolean[] isPrime= new boolean[100000001];

	public PrimeNumberGenerator() {
		//Date from = new Date();
		Arrays.fill(isPrime, true);

		isPrime[0] = false;
		isPrime[1] = false;
		isPrime[2] = true;

		for(int i = 3; i <= Math.sqrt( isPrime.length ); i+=2){
			/*
			if(i % 2 == 0){
				isPrime[i] = false;
				continue;
			}
			*/

			if(isPrime[i] == false){
				continue;
			}

			for(int j = i * 2; j <= isPrime.length - 1; j += i){
				isPrime[j] = false;
			}
		}
		//Date to = new Date();
		//System.out.println("init takes "+ (to.getTime() - from.getTime())+ "milli sec");
	}

	public boolean isPrime(int index){
		if(index % 2 == 0 && index != 2){
			return false;
		}
		return isPrime[index];
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Arrays; Arrays java.util import java.util.Date; Date java.util public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO ?????????????????????????????????????????????
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		PrimeNumberGenerator png = new PrimeNumberGenerator();
		int count = 0;

		for(int i = 0; i < n; i++){

			int m = Integer.parseInt(br.readLine());


			if(png.isPrime(m)){
					//System.out.println(i);
				count++;
			}


		}
		System.out.println(count);
	}

} Main public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO ?????????????????????????????????????????????
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		PrimeNumberGenerator png = new PrimeNumberGenerator();
		int count = 0;

		for(int i = 0; i < n; i++){

			int m = Integer.parseInt(br.readLine());


			if(png.isPrime(m)){
					//System.out.println(i);
				count++;
			}


		}
		System.out.println(count);
	} main {
		// TODO ?????????????????????????????????????????????
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		PrimeNumberGenerator png = new PrimeNumberGenerator();
		int count = 0;

		for(int i = 0; i < n; i++){

			int m = Integer.parseInt(br.readLine());


			if(png.isPrime(m)){
					//System.out.println(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 PrimeNumberGenerator png = new PrimeNumberGenerator(); png new PrimeNumberGenerator() int count = 0; count 0 for(int i = 0; i < n; i++){

			int m = Integer.parseInt(br.readLine());


			if(png.isPrime(m)){
					//System.out.println(i);
				count++;
			}


		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {

			int m = Integer.parseInt(br.readLine());


			if(png.isPrime(m)){
					//System.out.println(i);
				count++;
			}


		} {

			int m = Integer.parseInt(br.readLine());


			if(png.isPrime(m)){
					//System.out.println(i);
				count++;
			}


		} int m = Integer.parseInt(br.readLine()); m Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br if(png.isPrime(m)){
					//System.out.println(i);
				count++;
			} png.isPrime(m) png.isPrime png m {
					//System.out.println(i);
				count++;
			} count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args class PrimeNumberGenerator {
	private boolean[] isPrime= new boolean[100000001];

	public PrimeNumberGenerator() {
		//Date from = new Date();
		Arrays.fill(isPrime, true);

		isPrime[0] = false;
		isPrime[1] = false;
		isPrime[2] = true;

		for(int i = 3; i <= Math.sqrt( isPrime.length ); i+=2){
			/*
			if(i % 2 == 0){
				isPrime[i] = false;
				continue;
			}
			*/

			if(isPrime[i] == false){
				continue;
			}

			for(int j = i * 2; j <= isPrime.length - 1; j += i){
				isPrime[j] = false;
			}
		}
		//Date to = new Date();
		//System.out.println("init takes "+ (to.getTime() - from.getTime())+ "milli sec");
	}

	public boolean isPrime(int index){
		if(index % 2 == 0 && index != 2){
			return false;
		}
		return isPrime[index];
	}
} PrimeNumberGenerator private boolean[] isPrime= new boolean[100000001]; isPrime new boolean[100000001] 100000001 public PrimeNumberGenerator() {
		//Date from = new Date();
		Arrays.fill(isPrime, true);

		isPrime[0] = false;
		isPrime[1] = false;
		isPrime[2] = true;

		for(int i = 3; i <= Math.sqrt( isPrime.length ); i+=2){
			/*
			if(i % 2 == 0){
				isPrime[i] = false;
				continue;
			}
			*/

			if(isPrime[i] == false){
				continue;
			}

			for(int j = i * 2; j <= isPrime.length - 1; j += i){
				isPrime[j] = false;
			}
		}
		//Date to = new Date();
		//System.out.println("init takes "+ (to.getTime() - from.getTime())+ "milli sec");
	} PrimeNumberGenerator {
		//Date from = new Date();
		Arrays.fill(isPrime, true);

		isPrime[0] = false;
		isPrime[1] = false;
		isPrime[2] = true;

		for(int i = 3; i <= Math.sqrt( isPrime.length ); i+=2){
			/*
			if(i % 2 == 0){
				isPrime[i] = false;
				continue;
			}
			*/

			if(isPrime[i] == false){
				continue;
			}

			for(int j = i * 2; j <= isPrime.length - 1; j += i){
				isPrime[j] = false;
			}
		}
		//Date to = new Date();
		//System.out.println("init takes "+ (to.getTime() - from.getTime())+ "milli sec");
	} Arrays.fill(isPrime, true) Arrays.fill Arrays isPrime true isPrime[0] = false isPrime[0] isPrime 0 false isPrime[1] = false isPrime[1] isPrime 1 false isPrime[2] = true isPrime[2] isPrime 2 true for(int i = 3; i <= Math.sqrt( isPrime.length ); i+=2){
			/*
			if(i % 2 == 0){
				isPrime[i] = false;
				continue;
			}
			*/

			if(isPrime[i] == false){
				continue;
			}

			for(int j = i * 2; j <= isPrime.length - 1; j += i){
				isPrime[j] = false;
			}
		} int i = 3; int i = 3; i 3 i <= Math.sqrt( isPrime.length ) i Math.sqrt( isPrime.length ) Math.sqrt Math isPrime.length isPrime isPrime.length i+=2 i+=2 i 2 {
			/*
			if(i % 2 == 0){
				isPrime[i] = false;
				continue;
			}
			*/

			if(isPrime[i] == false){
				continue;
			}

			for(int j = i * 2; j <= isPrime.length - 1; j += i){
				isPrime[j] = false;
			}
		} {
			/*
			if(i % 2 == 0){
				isPrime[i] = false;
				continue;
			}
			*/

			if(isPrime[i] == false){
				continue;
			}

			for(int j = i * 2; j <= isPrime.length - 1; j += i){
				isPrime[j] = false;
			}
		} if(isPrime[i] == false){
				continue;
			} isPrime[i] == false isPrime[i] isPrime i false {
				continue;
			} continue; for(int j = i * 2; j <= isPrime.length - 1; j += i){
				isPrime[j] = false;
			} int j = i * 2; int j = i * 2; j i * 2 i 2 j <= isPrime.length - 1 j isPrime.length - 1 isPrime.length isPrime isPrime.length 1 j += i j += i j i {
				isPrime[j] = false;
			} {
				isPrime[j] = false;
			} isPrime[j] = false isPrime[j] isPrime j false public boolean isPrime(int index){
		if(index % 2 == 0 && index != 2){
			return false;
		}
		return isPrime[index];
	} isPrime {
		if(index % 2 == 0 && index != 2){
			return false;
		}
		return isPrime[index];
	} if(index % 2 == 0 && index != 2){
			return false;
		} index % 2 == 0 && index != 2 index % 2 == 0 index % 2 index 2 0 index != 2 index 2 {
			return false;
		} return false; false return isPrime[index]; isPrime[index] isPrime index int index index public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO ?????????????????????????????????????????????
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		PrimeNumberGenerator png = new PrimeNumberGenerator();
		int count = 0;

		for(int i = 0; i < n; i++){

			int m = Integer.parseInt(br.readLine());


			if(png.isPrime(m)){
					//System.out.println(i);
				count++;
			}


		}
		System.out.println(count);
	}

} public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO ?????????????????????????????????????????????
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		PrimeNumberGenerator png = new PrimeNumberGenerator();
		int count = 0;

		for(int i = 0; i < n; i++){

			int m = Integer.parseInt(br.readLine());


			if(png.isPrime(m)){
					//System.out.println(i);
				count++;
			}


		}
		System.out.println(count);
	}

} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Date;

public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO ?????????????????????????????????????????????
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		PrimeNumberGenerator png = new PrimeNumberGenerator();
		int count = 0;

		for(int i = 0; i < n; i++){

			int m = Integer.parseInt(br.readLine());


			if(png.isPrime(m)){
					//System.out.println(i);
				count++;
			}


		}
		System.out.println(count);
	}

}

class PrimeNumberGenerator {
	private boolean[] isPrime= new boolean[100000001];

	public PrimeNumberGenerator() {
		//Date from = new Date();
		Arrays.fill(isPrime, true);

		isPrime[0] = false;
		isPrime[1] = false;
		isPrime[2] = true;

		for(int i = 3; i <= Math.sqrt( isPrime.length ); i+=2){
			/*
			if(i % 2 == 0){
				isPrime[i] = false;
				continue;
			}
			*/

			if(isPrime[i] == false){
				continue;
			}

			for(int j = i * 2; j <= isPrime.length - 1; j += i){
				isPrime[j] = false;
			}
		}
		//Date to = new Date();
		//System.out.println("init takes "+ (to.getTime() - from.getTime())+ "milli sec");
	}

	public boolean isPrime(int index){
		if(index % 2 == 0 && index != 2){
			return false;
		}
		return isPrime[index];
	}
}