import java.util.Scanner;

public class Main {
	static int MAX_COUNT= 100000000;
	public static void main(String[] args){

		boolean[] isPrimeNumber = createIsPrimeNumber();
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int count = 0;
		for(int i = 0; i <N; i++){
			int temp= sc.nextInt();
			if(isPrimeNumber[temp - 1]){
				count++;
			}
		}
		sc.close();
		System.out.println(count);
	}
	
	public static boolean[] createIsPrimeNumber(){
		boolean[] isPrimeNumber = new boolean[MAX_COUNT];
		for(int i = 0; i <MAX_COUNT; i++){
			isPrimeNumber[i] = true;
		}
		isPrimeNumber[0] = false;
		for(int i = 2; i < MAX_COUNT; i++){
			if(isPrimeNumber[i - 1]){
				int count = 2;
				while(true){
					if((i * count - 1) >= MAX_COUNT ){
						break;
					}
					isPrimeNumber[i * count - 1] = false;
					count++;
				}
			}
		}
		return isPrimeNumber;
	}
}
/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