import java.util.Scanner;

class Main {

	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		int num = scan.nextInt();
		int[] array = new int[num];
		int count = 0;

		for (int i = 0; i < num; i++) {
			array[i] = scan.nextInt();
			if(isprime(array[i])) {
				count+=1;
			}
		}
		System.out.println(count);

		scan.close();
	}

	private 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.util.Scanner; Scanner java.util class Main {

	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		int num = scan.nextInt();
		int[] array = new int[num];
		int count = 0;

		for (int i = 0; i < num; i++) {
			array[i] = scan.nextInt();
			if(isprime(array[i])) {
				count+=1;
			}
		}
		System.out.println(count);

		scan.close();
	}

	private 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[]) {
		Scanner scan = new Scanner(System.in);
		int num = scan.nextInt();
		int[] array = new int[num];
		int count = 0;

		for (int i = 0; i < num; i++) {
			array[i] = scan.nextInt();
			if(isprime(array[i])) {
				count+=1;
			}
		}
		System.out.println(count);

		scan.close();
	} main {
		Scanner scan = new Scanner(System.in);
		int num = scan.nextInt();
		int[] array = new int[num];
		int count = 0;

		for (int i = 0; i < num; i++) {
			array[i] = scan.nextInt();
			if(isprime(array[i])) {
				count+=1;
			}
		}
		System.out.println(count);

		scan.close();
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int num = scan.nextInt(); num scan.nextInt() scan.nextInt scan int[] array = new int[num]; array new int[num] num int count = 0; count 0 for (int i = 0; i < num; i++) {
			array[i] = scan.nextInt();
			if(isprime(array[i])) {
				count+=1;
			}
		} int i = 0; int i = 0; i 0 i < num i num i++ i++ i {
			array[i] = scan.nextInt();
			if(isprime(array[i])) {
				count+=1;
			}
		} {
			array[i] = scan.nextInt();
			if(isprime(array[i])) {
				count+=1;
			}
		} array[i] = scan.nextInt() array[i] array i scan.nextInt() scan.nextInt scan if(isprime(array[i])) {
				count+=1;
			} isprime(array[i]) isprime array[i] array i {
				count+=1;
			} count+=1 count 1 System.out.println(count) System.out.println System.out System System.out count scan.close() scan.close scan String args[] args private 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.util.Scanner;

class Main {

	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		int num = scan.nextInt();
		int[] array = new int[num];
		int count = 0;

		for (int i = 0; i < num; i++) {
			array[i] = scan.nextInt();
			if(isprime(array[i])) {
				count+=1;
			}
		}
		System.out.println(count);

		scan.close();
	}

	private 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;
	}

}
