import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

/*Question
/?´???°??? 1 ??¨????????°??????????????§????????????????????¶??°????´???°??¨?¨?????????????
/????????°????????????8 ???????´???°???2, 3, 5, 7, 11, 13, 17, 19 ??¨???????????????1 ????´???°??§?????????????????????
/n ????????´??°???????????????????????????????????????????´???°?????°???????????????????????°???????????????????????????????????? 
*/

/*Input
/??????????????? n ?????????????????????????¶???? n ?????? n ????????´??°???????????????????????? 
*/

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader sc = new BufferedReader(new InputStreamReader(System.in));
		//????????¨
		boolean b;
		int count = 0;
		/*??\???
		/??????????´???°?????\???????¬??????°????????\???
		*/
		int n = Integer.parseInt(sc.readLine());
		int[] a = new int[n];
		for(int i = 0;i < n;i++){
			a[i] = Integer.parseInt(sc.readLine());
		}
		/*??°??????????????\???Prime???????????????
		/true??????count?????°???1?¢???????
		*/
		for (int s:a) {
			b = Prime(s);
			if (b) count++;
		}
		System.out.println(count);
	}

	/*Prime????????????
	/??????????????????????´???°???????????????????????????????????????
	/??????1?????????????¬????2??¨??¶??°?????????
	/??\??????3??????2??\????¢??????????????????§?????£????????????????????????
	*/

	public static boolean Prime(int s) {
		if (s < 2) return false;
		else if (s == 2) return true;
		else if (s % 2 == 0) return false;
		double sqrts = Math.sqrt(s);
		for (int i = 3; i <= sqrts; i += 2) {
		if (s % i == 0) {
			return false;
			}
		}
		return true;
	}
}
/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