import java.util.Scanner;
 
class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		int max = 100000001;
		boolean [] sosuu = new boolean [max];
		int [] n = new int [10000];
		int count = 0;
 
		for (int i = 1; i <= max - 1; i++) {
			sosuu[i] = true;
		}
		sosuu[0] = false;
		sosuu[1] = false;
 
		for (int i = 2; i <= Math.sqrt(max); i++) {
			if (sosuu[i] == true) {
				for (int j = i + i; j <= max - 1; j += i) {
					sosuu[j] = false;
				}
			}
 
		}
 
		Scanner cin = new Scanner (System.in);
		int x = cin.nextInt();
 
		for (int i = 0; i < x; i++) {
			n[i] = cin.nextInt();
			if (sosuu[n[i]] == true) count++;
		}
 
		System.out.println(count);
	}
 
	//private static void sosuulist() {
	//	
	//}
}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz