import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] numbers = new int[n];
		for (int i = 0; i < n; i++) {
			numbers[i] = sc.nextInt();
		}
		System.out.println(count(numbers, n));
		sc.close();
	}

	public static int count(int[] numbers, int n) {
		int count = 0;
		for (int i = 0; i < n; i++) {
			if (primeNumbers(numbers[i])) {
				count++;
			}
		}
		return count;

	}

	public static boolean primeNumbers(int num) {
		boolean flag = true;
		if (num == 2) {
			return flag;
		} else if (num % 2 == 0) {
			flag = false;
			return flag;
		} else {
			for (int i = 3; i <= Math.sqrt(num); i += 2) {
				if (num % i == 0) {
					flag = false;
					break;
				}
			}
			return flag;
		}

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

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] numbers = new int[n];
		for (int i = 0; i < n; i++) {
			numbers[i] = sc.nextInt();
		}
		System.out.println(count(numbers, n));
		sc.close();
	}

	public static int count(int[] numbers, int n) {
		int count = 0;
		for (int i = 0; i < n; i++) {
			if (primeNumbers(numbers[i])) {
				count++;
			}
		}
		return count;

	}

	public static boolean primeNumbers(int num) {
		boolean flag = true;
		if (num == 2) {
			return flag;
		} else if (num % 2 == 0) {
			flag = false;
			return flag;
		} else {
			for (int i = 3; i <= Math.sqrt(num); i += 2) {
				if (num % i == 0) {
					flag = false;
					break;
				}
			}
			return flag;
		}

	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] numbers = new int[n];
		for (int i = 0; i < n; i++) {
			numbers[i] = sc.nextInt();
		}
		System.out.println(count(numbers, n));
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] numbers = new int[n];
		for (int i = 0; i < n; i++) {
			numbers[i] = sc.nextInt();
		}
		System.out.println(count(numbers, n));
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] numbers = new int[n]; numbers new int[n] n for (int i = 0; i < n; i++) {
			numbers[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			numbers[i] = sc.nextInt();
		} {
			numbers[i] = sc.nextInt();
		} numbers[i] = sc.nextInt() numbers[i] numbers i sc.nextInt() sc.nextInt sc System.out.println(count(numbers, n)) System.out.println System.out System System.out count(numbers, n) count numbers n sc.close() sc.close sc String[] args args public static int count(int[] numbers, int n) {
		int count = 0;
		for (int i = 0; i < n; i++) {
			if (primeNumbers(numbers[i])) {
				count++;
			}
		}
		return count;

	} count {
		int count = 0;
		for (int i = 0; i < n; i++) {
			if (primeNumbers(numbers[i])) {
				count++;
			}
		}
		return count;

	} int count = 0; count 0 for (int i = 0; i < n; i++) {
			if (primeNumbers(numbers[i])) {
				count++;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			if (primeNumbers(numbers[i])) {
				count++;
			}
		} {
			if (primeNumbers(numbers[i])) {
				count++;
			}
		} if (primeNumbers(numbers[i])) {
				count++;
			} primeNumbers(numbers[i]) primeNumbers numbers[i] numbers i {
				count++;
			} count++ count return count; count int[] numbers numbers int n n public static boolean primeNumbers(int num) {
		boolean flag = true;
		if (num == 2) {
			return flag;
		} else if (num % 2 == 0) {
			flag = false;
			return flag;
		} else {
			for (int i = 3; i <= Math.sqrt(num); i += 2) {
				if (num % i == 0) {
					flag = false;
					break;
				}
			}
			return flag;
		}

	} primeNumbers {
		boolean flag = true;
		if (num == 2) {
			return flag;
		} else if (num % 2 == 0) {
			flag = false;
			return flag;
		} else {
			for (int i = 3; i <= Math.sqrt(num); i += 2) {
				if (num % i == 0) {
					flag = false;
					break;
				}
			}
			return flag;
		}

	} boolean flag = true; flag true if (num == 2) {
			return flag;
		} else if (num % 2 == 0) {
			flag = false;
			return flag;
		} else {
			for (int i = 3; i <= Math.sqrt(num); i += 2) {
				if (num % i == 0) {
					flag = false;
					break;
				}
			}
			return flag;
		} num == 2 num 2 {
			return flag;
		} return flag; flag if (num % 2 == 0) {
			flag = false;
			return flag;
		} else {
			for (int i = 3; i <= Math.sqrt(num); i += 2) {
				if (num % i == 0) {
					flag = false;
					break;
				}
			}
			return flag;
		} num % 2 == 0 num % 2 num 2 0 {
			flag = false;
			return flag;
		} flag = false flag false return flag; flag {
			for (int i = 3; i <= Math.sqrt(num); i += 2) {
				if (num % i == 0) {
					flag = false;
					break;
				}
			}
			return flag;
		} for (int i = 3; i <= Math.sqrt(num); i += 2) {
				if (num % i == 0) {
					flag = false;
					break;
				}
			} int i = 3; int i = 3; i 3 i <= Math.sqrt(num) i Math.sqrt(num) Math.sqrt Math num i += 2 i += 2 i 2 {
				if (num % i == 0) {
					flag = false;
					break;
				}
			} {
				if (num % i == 0) {
					flag = false;
					break;
				}
			} if (num % i == 0) {
					flag = false;
					break;
				} num % i == 0 num % i num i 0 {
					flag = false;
					break;
				} flag = false flag false break; return flag; flag int num num public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] numbers = new int[n];
		for (int i = 0; i < n; i++) {
			numbers[i] = sc.nextInt();
		}
		System.out.println(count(numbers, n));
		sc.close();
	}

	public static int count(int[] numbers, int n) {
		int count = 0;
		for (int i = 0; i < n; i++) {
			if (primeNumbers(numbers[i])) {
				count++;
			}
		}
		return count;

	}

	public static boolean primeNumbers(int num) {
		boolean flag = true;
		if (num == 2) {
			return flag;
		} else if (num % 2 == 0) {
			flag = false;
			return flag;
		} else {
			for (int i = 3; i <= Math.sqrt(num); i += 2) {
				if (num % i == 0) {
					flag = false;
					break;
				}
			}
			return flag;
		}

	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] numbers = new int[n];
		for (int i = 0; i < n; i++) {
			numbers[i] = sc.nextInt();
		}
		System.out.println(count(numbers, n));
		sc.close();
	}

	public static int count(int[] numbers, int n) {
		int count = 0;
		for (int i = 0; i < n; i++) {
			if (primeNumbers(numbers[i])) {
				count++;
			}
		}
		return count;

	}

	public static boolean primeNumbers(int num) {
		boolean flag = true;
		if (num == 2) {
			return flag;
		} else if (num % 2 == 0) {
			flag = false;
			return flag;
		} else {
			for (int i = 3; i <= Math.sqrt(num); i += 2) {
				if (num % i == 0) {
					flag = false;
					break;
				}
			}
			return flag;
		}

	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] numbers = new int[n];
		for (int i = 0; i < n; i++) {
			numbers[i] = sc.nextInt();
		}
		System.out.println(count(numbers, n));
		sc.close();
	}

	public static int count(int[] numbers, int n) {
		int count = 0;
		for (int i = 0; i < n; i++) {
			if (primeNumbers(numbers[i])) {
				count++;
			}
		}
		return count;

	}

	public static boolean primeNumbers(int num) {
		boolean flag = true;
		if (num == 2) {
			return flag;
		} else if (num % 2 == 0) {
			flag = false;
			return flag;
		} else {
			for (int i = 3; i <= Math.sqrt(num); i += 2) {
				if (num % i == 0) {
					flag = false;
					break;
				}
			}
			return flag;
		}

	}
}

