import java.io.IOException;
import java.util.Scanner;
class Main{
	public static void main(String[] args)throws NumberFormatException, IOException{
//		System.out.println(" ");
		Scanner scan = new Scanner(System.in);
		int times = scan.nextInt();
		int num[] =new int[times];
		int keisan = 0;
		int sosu = 0;
		boolean tf = true;
		for(int i=0;i<times;i++){
			num[i] = scan.nextInt();
		}

		for(int i=0;i<times;i++){
			tf = true;
			if(num[i] == 2 || num[i] % 2 == 0){
				tf = false;
			}
			int ii=3;
			while (ii <= Math.sqrt(num[i])){
				if(num[i] % ii == 0){
					tf = false;
				}
				ii += 2;
			}
			if (num[i] == 2){
				tf = true;
			}
			if(tf == true){
				sosu +=1;
			}
		}
		System.out.println(sosu);
	}
}
/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