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;
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util 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;
	}
} 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);
	} main {
		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);
	} BufferedReader sc = new BufferedReader(new InputStreamReader(System.in)); sc new BufferedReader(new InputStreamReader(System.in)) boolean b; b int count = 0; count 0 int n = Integer.parseInt(sc.readLine()); n Integer.parseInt(sc.readLine()) Integer.parseInt Integer sc.readLine() sc.readLine sc int[] a = new int[n]; a new int[n] n for(int i = 0;i < n;i++){
			a[i] = Integer.parseInt(sc.readLine());
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			a[i] = Integer.parseInt(sc.readLine());
		} {
			a[i] = Integer.parseInt(sc.readLine());
		} a[i] = Integer.parseInt(sc.readLine()) a[i] a i Integer.parseInt(sc.readLine()) Integer.parseInt Integer sc.readLine() sc.readLine sc for (int s:a) {
			b = Prime(s);
			if (b) count++;
		} int s a {
			b = Prime(s);
			if (b) count++;
		} {
			b = Prime(s);
			if (b) count++;
		} b = Prime(s) b Prime(s) Prime s if (b) count++; b count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args 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;
	} Prime {
		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;
	} if (s < 2) return false;
		else if (s == 2) return true;
		else if (s % 2 == 0) return false; s < 2 s 2 return false; false if (s == 2) return true;
		else if (s % 2 == 0) return false; s == 2 s 2 return true; true if (s % 2 == 0) return false; s % 2 == 0 s % 2 s 2 0 return false; false double sqrts = Math.sqrt(s); sqrts Math.sqrt(s) Math.sqrt Math s for (int i = 3; i <= sqrts; i += 2) {
		if (s % i == 0) {
			return false;
			}
		} int i = 3; int i = 3; i 3 i <= sqrts i sqrts i += 2 i += 2 i 2 {
		if (s % i == 0) {
			return false;
			}
		} {
		if (s % i == 0) {
			return false;
			}
		} if (s % i == 0) {
			return false;
			} s % i == 0 s % i s i 0 {
			return false;
			} return false; false return true; true int s s 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;
	}
} 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;
	}
} Main
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;
	}
}