import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		String line1 = sc.nextLine();
		int n = Integer.parseInt(line1);

		int[] num = new int[n];

		for (int i = 0; i < n; i++) {
			String kari = sc.nextLine();
			num[i] = Integer.parseInt(kari);
		}

		int answer = 0;

		for (int i = 0; i < n; i++) {
			if (num[i] == 2) {
				answer++;
			} else if (num[i] % 2 != 0 && num[i] >= 3) {
				double sq = Math.sqrt((double) num[i]);
				int sqr = (int) sq +1;

				int j = 3;
				int breakcount = 0;
				while (j <= sqr) {
					if (num[i] % j == 0) {
						breakcount = 1;
						break;
					}
					j += 2;
				}
				if (breakcount == 0) {
					answer++;
				}
			}
		}
		System.out.println(answer);

	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		String line1 = sc.nextLine();
		int n = Integer.parseInt(line1);

		int[] num = new int[n];

		for (int i = 0; i < n; i++) {
			String kari = sc.nextLine();
			num[i] = Integer.parseInt(kari);
		}

		int answer = 0;

		for (int i = 0; i < n; i++) {
			if (num[i] == 2) {
				answer++;
			} else if (num[i] % 2 != 0 && num[i] >= 3) {
				double sq = Math.sqrt((double) num[i]);
				int sqr = (int) sq +1;

				int j = 3;
				int breakcount = 0;
				while (j <= sqr) {
					if (num[i] % j == 0) {
						breakcount = 1;
						break;
					}
					j += 2;
				}
				if (breakcount == 0) {
					answer++;
				}
			}
		}
		System.out.println(answer);

	}

} Main public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		String line1 = sc.nextLine();
		int n = Integer.parseInt(line1);

		int[] num = new int[n];

		for (int i = 0; i < n; i++) {
			String kari = sc.nextLine();
			num[i] = Integer.parseInt(kari);
		}

		int answer = 0;

		for (int i = 0; i < n; i++) {
			if (num[i] == 2) {
				answer++;
			} else if (num[i] % 2 != 0 && num[i] >= 3) {
				double sq = Math.sqrt((double) num[i]);
				int sqr = (int) sq +1;

				int j = 3;
				int breakcount = 0;
				while (j <= sqr) {
					if (num[i] % j == 0) {
						breakcount = 1;
						break;
					}
					j += 2;
				}
				if (breakcount == 0) {
					answer++;
				}
			}
		}
		System.out.println(answer);

	} main {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		String line1 = sc.nextLine();
		int n = Integer.parseInt(line1);

		int[] num = new int[n];

		for (int i = 0; i < n; i++) {
			String kari = sc.nextLine();
			num[i] = Integer.parseInt(kari);
		}

		int answer = 0;

		for (int i = 0; i < n; i++) {
			if (num[i] == 2) {
				answer++;
			} else if (num[i] % 2 != 0 && num[i] >= 3) {
				double sq = Math.sqrt((double) num[i]);
				int sqr = (int) sq +1;

				int j = 3;
				int breakcount = 0;
				while (j <= sqr) {
					if (num[i] % j == 0) {
						breakcount = 1;
						break;
					}
					j += 2;
				}
				if (breakcount == 0) {
					answer++;
				}
			}
		}
		System.out.println(answer);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String line1 = sc.nextLine(); line1 sc.nextLine() sc.nextLine sc int n = Integer.parseInt(line1); n Integer.parseInt(line1) Integer.parseInt Integer line1 int[] num = new int[n]; num new int[n] n for (int i = 0; i < n; i++) {
			String kari = sc.nextLine();
			num[i] = Integer.parseInt(kari);
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			String kari = sc.nextLine();
			num[i] = Integer.parseInt(kari);
		} {
			String kari = sc.nextLine();
			num[i] = Integer.parseInt(kari);
		} String kari = sc.nextLine(); kari sc.nextLine() sc.nextLine sc num[i] = Integer.parseInt(kari) num[i] num i Integer.parseInt(kari) Integer.parseInt Integer kari int answer = 0; answer 0 for (int i = 0; i < n; i++) {
			if (num[i] == 2) {
				answer++;
			} else if (num[i] % 2 != 0 && num[i] >= 3) {
				double sq = Math.sqrt((double) num[i]);
				int sqr = (int) sq +1;

				int j = 3;
				int breakcount = 0;
				while (j <= sqr) {
					if (num[i] % j == 0) {
						breakcount = 1;
						break;
					}
					j += 2;
				}
				if (breakcount == 0) {
					answer++;
				}
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			if (num[i] == 2) {
				answer++;
			} else if (num[i] % 2 != 0 && num[i] >= 3) {
				double sq = Math.sqrt((double) num[i]);
				int sqr = (int) sq +1;

				int j = 3;
				int breakcount = 0;
				while (j <= sqr) {
					if (num[i] % j == 0) {
						breakcount = 1;
						break;
					}
					j += 2;
				}
				if (breakcount == 0) {
					answer++;
				}
			}
		} {
			if (num[i] == 2) {
				answer++;
			} else if (num[i] % 2 != 0 && num[i] >= 3) {
				double sq = Math.sqrt((double) num[i]);
				int sqr = (int) sq +1;

				int j = 3;
				int breakcount = 0;
				while (j <= sqr) {
					if (num[i] % j == 0) {
						breakcount = 1;
						break;
					}
					j += 2;
				}
				if (breakcount == 0) {
					answer++;
				}
			}
		} if (num[i] == 2) {
				answer++;
			} else if (num[i] % 2 != 0 && num[i] >= 3) {
				double sq = Math.sqrt((double) num[i]);
				int sqr = (int) sq +1;

				int j = 3;
				int breakcount = 0;
				while (j <= sqr) {
					if (num[i] % j == 0) {
						breakcount = 1;
						break;
					}
					j += 2;
				}
				if (breakcount == 0) {
					answer++;
				}
			} num[i] == 2 num[i] num i 2 {
				answer++;
			} answer++ answer if (num[i] % 2 != 0 && num[i] >= 3) {
				double sq = Math.sqrt((double) num[i]);
				int sqr = (int) sq +1;

				int j = 3;
				int breakcount = 0;
				while (j <= sqr) {
					if (num[i] % j == 0) {
						breakcount = 1;
						break;
					}
					j += 2;
				}
				if (breakcount == 0) {
					answer++;
				}
			} num[i] % 2 != 0 && num[i] >= 3 num[i] % 2 != 0 num[i] % 2 num[i] num i 2 0 num[i] >= 3 num[i] num i 3 {
				double sq = Math.sqrt((double) num[i]);
				int sqr = (int) sq +1;

				int j = 3;
				int breakcount = 0;
				while (j <= sqr) {
					if (num[i] % j == 0) {
						breakcount = 1;
						break;
					}
					j += 2;
				}
				if (breakcount == 0) {
					answer++;
				}
			} double sq = Math.sqrt((double) num[i]); sq Math.sqrt((double) num[i]) Math.sqrt Math (double) num[i] num i int sqr = (int) sq +1; sqr (int) sq +1 (int) sq 1 int j = 3; j 3 int breakcount = 0; breakcount 0 while (j <= sqr) {
					if (num[i] % j == 0) {
						breakcount = 1;
						break;
					}
					j += 2;
				} j <= sqr j sqr {
					if (num[i] % j == 0) {
						breakcount = 1;
						break;
					}
					j += 2;
				} if (num[i] % j == 0) {
						breakcount = 1;
						break;
					} num[i] % j == 0 num[i] % j num[i] num i j 0 {
						breakcount = 1;
						break;
					} breakcount = 1 breakcount 1 break; j += 2 j 2 if (breakcount == 0) {
					answer++;
				} breakcount == 0 breakcount 0 {
					answer++;
				} answer++ answer System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		String line1 = sc.nextLine();
		int n = Integer.parseInt(line1);

		int[] num = new int[n];

		for (int i = 0; i < n; i++) {
			String kari = sc.nextLine();
			num[i] = Integer.parseInt(kari);
		}

		int answer = 0;

		for (int i = 0; i < n; i++) {
			if (num[i] == 2) {
				answer++;
			} else if (num[i] % 2 != 0 && num[i] >= 3) {
				double sq = Math.sqrt((double) num[i]);
				int sqr = (int) sq +1;

				int j = 3;
				int breakcount = 0;
				while (j <= sqr) {
					if (num[i] % j == 0) {
						breakcount = 1;
						break;
					}
					j += 2;
				}
				if (breakcount == 0) {
					answer++;
				}
			}
		}
		System.out.println(answer);

	}

} public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		String line1 = sc.nextLine();
		int n = Integer.parseInt(line1);

		int[] num = new int[n];

		for (int i = 0; i < n; i++) {
			String kari = sc.nextLine();
			num[i] = Integer.parseInt(kari);
		}

		int answer = 0;

		for (int i = 0; i < n; i++) {
			if (num[i] == 2) {
				answer++;
			} else if (num[i] % 2 != 0 && num[i] >= 3) {
				double sq = Math.sqrt((double) num[i]);
				int sqr = (int) sq +1;

				int j = 3;
				int breakcount = 0;
				while (j <= sqr) {
					if (num[i] % j == 0) {
						breakcount = 1;
						break;
					}
					j += 2;
				}
				if (breakcount == 0) {
					answer++;
				}
			}
		}
		System.out.println(answer);

	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		String line1 = sc.nextLine();
		int n = Integer.parseInt(line1);

		int[] num = new int[n];

		for (int i = 0; i < n; i++) {
			String kari = sc.nextLine();
			num[i] = Integer.parseInt(kari);
		}

		int answer = 0;

		for (int i = 0; i < n; i++) {
			if (num[i] == 2) {
				answer++;
			} else if (num[i] % 2 != 0 && num[i] >= 3) {
				double sq = Math.sqrt((double) num[i]);
				int sqr = (int) sq +1;

				int j = 3;
				int breakcount = 0;
				while (j <= sqr) {
					if (num[i] % j == 0) {
						breakcount = 1;
						break;
					}
					j += 2;
				}
				if (breakcount == 0) {
					answer++;
				}
			}
		}
		System.out.println(answer);

	}

}