import java.util.*;

class Main{
	public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		Number num = new Number();
		List<Integer> list = num.getPrimeNumbers(10000);
		int n = scan.nextInt();
		int[] arr = new int[n];
		for(int i=0; i<n; i++) {
			arr[i] = scan.nextInt();
		}
		//int k = 2;
		int k = 0;
		int flag = 1; //0???????´???°??§????????????1???????´???°
		int cnt = 0; //?´???°?????°???????????????
		for(int i=0; i<arr.length; i++){
			while(k <= Math.sqrt(arr[i])+1){
			//while(arr[i] != k){
			//while(list.hasnext()){
				//System.out.println("arr[i]:" + arr[i] + ",k:" + k + ",??????:" + arr[i] % k);
				if(arr[i] % list.get(k) == 0){
					flag = 0;
					break;
				}
				k++;
			}
			if(flag == 1){cnt++;}
			flag = 1;
			//k = 2;
			k = 0;
		}
		System.out.println(cnt);
	}
}

class Number{
	//1???????????°a?????§????´???°???int???????????§??????
	public List<Integer> getPrimeNumbers(int a){
		List<Integer> list = new ArrayList<Integer>();
		int k = 2;
		int flag = 1; //0???????´???°??§????????????1???????´???°
		for(int i=2; i<a; i++){
			while(1 != k){
				if(i % k == 0){
					flag = 0;
					break;
				}
				k++;
			}
			if(flag == 1){list.add(i);}
			flag = 1;
			k = 2;
		}
		return list;
	}
}