import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();

		int count = 0;
		for (int i = 0; i < n; i++) {
			int v = scn.nextInt();
			boolean bol = true;
			if (v == 2) {
				count++;
				continue;
			} else if (v % 2 == 0) {
				continue;
			}
			for (int j = 3; j <= Math.sqrt((double)v); j++) {
				if (v % j == 0) {
					bol = false;
					break;
				}
			}
			if (bol) {
				count++;
			}
		}
		System.out.println(count);
	}
}
 import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();

		int count = 0;
		for (int i = 0; i < n; i++) {
			int v = scn.nextInt();
			boolean bol = true;
			if (v == 2) {
				count++;
				continue;
			} else if (v % 2 == 0) {
				continue;
			}
			for (int j = 3; j <= Math.sqrt((double)v); j++) {
				if (v % j == 0) {
					bol = false;
					break;
				}
			}
			if (bol) {
				count++;
			}
		}
		System.out.println(count);
	}
} Main public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();

		int count = 0;
		for (int i = 0; i < n; i++) {
			int v = scn.nextInt();
			boolean bol = true;
			if (v == 2) {
				count++;
				continue;
			} else if (v % 2 == 0) {
				continue;
			}
			for (int j = 3; j <= Math.sqrt((double)v); j++) {
				if (v % j == 0) {
					bol = false;
					break;
				}
			}
			if (bol) {
				count++;
			}
		}
		System.out.println(count);
	} main {
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();

		int count = 0;
		for (int i = 0; i < n; i++) {
			int v = scn.nextInt();
			boolean bol = true;
			if (v == 2) {
				count++;
				continue;
			} else if (v % 2 == 0) {
				continue;
			}
			for (int j = 3; j <= Math.sqrt((double)v); j++) {
				if (v % j == 0) {
					bol = false;
					break;
				}
			}
			if (bol) {
				count++;
			}
		}
		System.out.println(count);
	} Scanner scn = new Scanner(System.in); scn new Scanner(System.in) int n = scn.nextInt(); n scn.nextInt() scn.nextInt scn int count = 0; count 0 for (int i = 0; i < n; i++) {
			int v = scn.nextInt();
			boolean bol = true;
			if (v == 2) {
				count++;
				continue;
			} else if (v % 2 == 0) {
				continue;
			}
			for (int j = 3; j <= Math.sqrt((double)v); j++) {
				if (v % j == 0) {
					bol = false;
					break;
				}
			}
			if (bol) {
				count++;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			int v = scn.nextInt();
			boolean bol = true;
			if (v == 2) {
				count++;
				continue;
			} else if (v % 2 == 0) {
				continue;
			}
			for (int j = 3; j <= Math.sqrt((double)v); j++) {
				if (v % j == 0) {
					bol = false;
					break;
				}
			}
			if (bol) {
				count++;
			}
		} {
			int v = scn.nextInt();
			boolean bol = true;
			if (v == 2) {
				count++;
				continue;
			} else if (v % 2 == 0) {
				continue;
			}
			for (int j = 3; j <= Math.sqrt((double)v); j++) {
				if (v % j == 0) {
					bol = false;
					break;
				}
			}
			if (bol) {
				count++;
			}
		} int v = scn.nextInt(); v scn.nextInt() scn.nextInt scn boolean bol = true; bol true if (v == 2) {
				count++;
				continue;
			} else if (v % 2 == 0) {
				continue;
			} v == 2 v 2 {
				count++;
				continue;
			} count++ count continue; if (v % 2 == 0) {
				continue;
			} v % 2 == 0 v % 2 v 2 0 {
				continue;
			} continue; for (int j = 3; j <= Math.sqrt((double)v); j++) {
				if (v % j == 0) {
					bol = false;
					break;
				}
			} int j = 3; int j = 3; j 3 j <= Math.sqrt((double)v) j Math.sqrt((double)v) Math.sqrt Math (double)v j++ j++ j {
				if (v % j == 0) {
					bol = false;
					break;
				}
			} {
				if (v % j == 0) {
					bol = false;
					break;
				}
			} if (v % j == 0) {
					bol = false;
					break;
				} v % j == 0 v % j v j 0 {
					bol = false;
					break;
				} bol = false bol false break; if (bol) {
				count++;
			} bol {
				count++;
			} count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();

		int count = 0;
		for (int i = 0; i < n; i++) {
			int v = scn.nextInt();
			boolean bol = true;
			if (v == 2) {
				count++;
				continue;
			} else if (v % 2 == 0) {
				continue;
			}
			for (int j = 3; j <= Math.sqrt((double)v); j++) {
				if (v % j == 0) {
					bol = false;
					break;
				}
			}
			if (bol) {
				count++;
			}
		}
		System.out.println(count);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();

		int count = 0;
		for (int i = 0; i < n; i++) {
			int v = scn.nextInt();
			boolean bol = true;
			if (v == 2) {
				count++;
				continue;
			} else if (v % 2 == 0) {
				continue;
			}
			for (int j = 3; j <= Math.sqrt((double)v); j++) {
				if (v % j == 0) {
					bol = false;
					break;
				}
			}
			if (bol) {
				count++;
			}
		}
		System.out.println(count);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();

		int count = 0;
		for (int i = 0; i < n; i++) {
			int v = scn.nextInt();
			boolean bol = true;
			if (v == 2) {
				count++;
				continue;
			} else if (v % 2 == 0) {
				continue;
			}
			for (int j = 3; j <= Math.sqrt((double)v); j++) {
				if (v % j == 0) {
					bol = false;
					break;
				}
			}
			if (bol) {
				count++;
			}
		}
		System.out.println(count);
	}
}

