import java.util.Scanner;

public class Main {
	
	static int[] memo = new int[45];
	
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		
		int n = in.nextInt();
		int cnt = 0;
		for (int i = 0; i < n; i++) {
			int a = in.nextInt();
			if (isPrime(a)) {
				cnt++;
			}
		}
		System.out.println(cnt);
	}
	
	static boolean isPrime(int a) {
		if (a <= 1) return false;
		
		if (a != 2 && a%2 == 0) return false;
		
		int max = (int) Math.sqrt(a)+1;
		for (int i = 3; i < max; i++) {
			if (a%i == 0) return false;
		}
		return true;
	}
}
 import java.util.Scanner; Scanner java.util public class Main {
	
	static int[] memo = new int[45];
	
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		
		int n = in.nextInt();
		int cnt = 0;
		for (int i = 0; i < n; i++) {
			int a = in.nextInt();
			if (isPrime(a)) {
				cnt++;
			}
		}
		System.out.println(cnt);
	}
	
	static boolean isPrime(int a) {
		if (a <= 1) return false;
		
		if (a != 2 && a%2 == 0) return false;
		
		int max = (int) Math.sqrt(a)+1;
		for (int i = 3; i < max; i++) {
			if (a%i == 0) return false;
		}
		return true;
	}
} Main static int[] memo = new int[45]; memo new int[45] 45 public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		
		int n = in.nextInt();
		int cnt = 0;
		for (int i = 0; i < n; i++) {
			int a = in.nextInt();
			if (isPrime(a)) {
				cnt++;
			}
		}
		System.out.println(cnt);
	} main {
		Scanner in = new Scanner(System.in);
		
		int n = in.nextInt();
		int cnt = 0;
		for (int i = 0; i < n; i++) {
			int a = in.nextInt();
			if (isPrime(a)) {
				cnt++;
			}
		}
		System.out.println(cnt);
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) int n = in.nextInt(); n in.nextInt() in.nextInt in int cnt = 0; cnt 0 for (int i = 0; i < n; i++) {
			int a = in.nextInt();
			if (isPrime(a)) {
				cnt++;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			int a = in.nextInt();
			if (isPrime(a)) {
				cnt++;
			}
		} {
			int a = in.nextInt();
			if (isPrime(a)) {
				cnt++;
			}
		} int a = in.nextInt(); a in.nextInt() in.nextInt in if (isPrime(a)) {
				cnt++;
			} isPrime(a) isPrime a {
				cnt++;
			} cnt++ cnt System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args static boolean isPrime(int a) {
		if (a <= 1) return false;
		
		if (a != 2 && a%2 == 0) return false;
		
		int max = (int) Math.sqrt(a)+1;
		for (int i = 3; i < max; i++) {
			if (a%i == 0) return false;
		}
		return true;
	} isPrime {
		if (a <= 1) return false;
		
		if (a != 2 && a%2 == 0) return false;
		
		int max = (int) Math.sqrt(a)+1;
		for (int i = 3; i < max; i++) {
			if (a%i == 0) return false;
		}
		return true;
	} if (a <= 1) return false; a <= 1 a 1 return false; false if (a != 2 && a%2 == 0) return false; a != 2 && a%2 == 0 a != 2 a 2 a%2 == 0 a%2 a 2 0 return false; false int max = (int) Math.sqrt(a)+1; max (int) Math.sqrt(a)+1 (int) Math.sqrt(a) Math.sqrt Math a 1 for (int i = 3; i < max; i++) {
			if (a%i == 0) return false;
		} int i = 3; int i = 3; i 3 i < max i max i++ i++ i {
			if (a%i == 0) return false;
		} {
			if (a%i == 0) return false;
		} if (a%i == 0) return false; a%i == 0 a%i a i 0 return false; false return true; true int a a public class Main {
	
	static int[] memo = new int[45];
	
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		
		int n = in.nextInt();
		int cnt = 0;
		for (int i = 0; i < n; i++) {
			int a = in.nextInt();
			if (isPrime(a)) {
				cnt++;
			}
		}
		System.out.println(cnt);
	}
	
	static boolean isPrime(int a) {
		if (a <= 1) return false;
		
		if (a != 2 && a%2 == 0) return false;
		
		int max = (int) Math.sqrt(a)+1;
		for (int i = 3; i < max; i++) {
			if (a%i == 0) return false;
		}
		return true;
	}
} public class Main {
	
	static int[] memo = new int[45];
	
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		
		int n = in.nextInt();
		int cnt = 0;
		for (int i = 0; i < n; i++) {
			int a = in.nextInt();
			if (isPrime(a)) {
				cnt++;
			}
		}
		System.out.println(cnt);
	}
	
	static boolean isPrime(int a) {
		if (a <= 1) return false;
		
		if (a != 2 && a%2 == 0) return false;
		
		int max = (int) Math.sqrt(a)+1;
		for (int i = 3; i < max; i++) {
			if (a%i == 0) return false;
		}
		return true;
	}
} Main
import java.util.Scanner;

public class Main {
	
	static int[] memo = new int[45];
	
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		
		int n = in.nextInt();
		int cnt = 0;
		for (int i = 0; i < n; i++) {
			int a = in.nextInt();
			if (isPrime(a)) {
				cnt++;
			}
		}
		System.out.println(cnt);
	}
	
	static boolean isPrime(int a) {
		if (a <= 1) return false;
		
		if (a != 2 && a%2 == 0) return false;
		
		int max = (int) Math.sqrt(a)+1;
		for (int i = 3; i < max; i++) {
			if (a%i == 0) return false;
		}
		return true;
	}
}

