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

public 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 primeCnt = 0;
		for (int i = 0; i < n; i++) {
			if (checkPrimeNumber(Integer.parseInt(br.readLine()))) primeCnt++;
		}
		System.out.println(primeCnt);
	}

	public static boolean checkPrimeNumber(int target) {
		if (target < 2) return false;
		if (target == 2) return true;
		if (target % 2 == 0) return false;

		for (int i = 3; i <= Math.sqrt(target); i++) {
			if (target % i == 0) return false;
		}
		return true;
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public 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 primeCnt = 0;
		for (int i = 0; i < n; i++) {
			if (checkPrimeNumber(Integer.parseInt(br.readLine()))) primeCnt++;
		}
		System.out.println(primeCnt);
	}

	public static boolean checkPrimeNumber(int target) {
		if (target < 2) return false;
		if (target == 2) return true;
		if (target % 2 == 0) return false;

		for (int i = 3; i <= Math.sqrt(target); i++) {
			if (target % i == 0) return false;
		}
		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 primeCnt = 0;
		for (int i = 0; i < n; i++) {
			if (checkPrimeNumber(Integer.parseInt(br.readLine()))) primeCnt++;
		}
		System.out.println(primeCnt);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int primeCnt = 0;
		for (int i = 0; i < n; i++) {
			if (checkPrimeNumber(Integer.parseInt(br.readLine()))) primeCnt++;
		}
		System.out.println(primeCnt);
	} 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 primeCnt = 0; primeCnt 0 for (int i = 0; i < n; i++) {
			if (checkPrimeNumber(Integer.parseInt(br.readLine()))) primeCnt++;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			if (checkPrimeNumber(Integer.parseInt(br.readLine()))) primeCnt++;
		} {
			if (checkPrimeNumber(Integer.parseInt(br.readLine()))) primeCnt++;
		} if (checkPrimeNumber(Integer.parseInt(br.readLine()))) primeCnt++; checkPrimeNumber(Integer.parseInt(br.readLine())) checkPrimeNumber Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br primeCnt++ primeCnt System.out.println(primeCnt) System.out.println System.out System System.out primeCnt String[] args args public static boolean checkPrimeNumber(int target) {
		if (target < 2) return false;
		if (target == 2) return true;
		if (target % 2 == 0) return false;

		for (int i = 3; i <= Math.sqrt(target); i++) {
			if (target % i == 0) return false;
		}
		return true;
	} checkPrimeNumber {
		if (target < 2) return false;
		if (target == 2) return true;
		if (target % 2 == 0) return false;

		for (int i = 3; i <= Math.sqrt(target); i++) {
			if (target % i == 0) return false;
		}
		return true;
	} if (target < 2) return false; target < 2 target 2 return false; false if (target == 2) return true; target == 2 target 2 return true; true if (target % 2 == 0) return false; target % 2 == 0 target % 2 target 2 0 return false; false for (int i = 3; i <= Math.sqrt(target); i++) {
			if (target % i == 0) return false;
		} int i = 3; int i = 3; i 3 i <= Math.sqrt(target) i Math.sqrt(target) Math.sqrt Math target i++ i++ i {
			if (target % i == 0) return false;
		} {
			if (target % i == 0) return false;
		} if (target % i == 0) return false; target % i == 0 target % i target i 0 return false; false return true; true int target target public 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 primeCnt = 0;
		for (int i = 0; i < n; i++) {
			if (checkPrimeNumber(Integer.parseInt(br.readLine()))) primeCnt++;
		}
		System.out.println(primeCnt);
	}

	public static boolean checkPrimeNumber(int target) {
		if (target < 2) return false;
		if (target == 2) return true;
		if (target % 2 == 0) return false;

		for (int i = 3; i <= Math.sqrt(target); i++) {
			if (target % i == 0) return false;
		}
		return true;
	}
} public 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 primeCnt = 0;
		for (int i = 0; i < n; i++) {
			if (checkPrimeNumber(Integer.parseInt(br.readLine()))) primeCnt++;
		}
		System.out.println(primeCnt);
	}

	public static boolean checkPrimeNumber(int target) {
		if (target < 2) return false;
		if (target == 2) return true;
		if (target % 2 == 0) return false;

		for (int i = 3; i <= Math.sqrt(target); i++) {
			if (target % i == 0) return false;
		}
		return true;
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public 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 primeCnt = 0;
		for (int i = 0; i < n; i++) {
			if (checkPrimeNumber(Integer.parseInt(br.readLine()))) primeCnt++;
		}
		System.out.println(primeCnt);
	}

	public static boolean checkPrimeNumber(int target) {
		if (target < 2) return false;
		if (target == 2) return true;
		if (target % 2 == 0) return false;

		for (int i = 3; i <= Math.sqrt(target); i++) {
			if (target % i == 0) return false;
		}
		return true;
	}
}