import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		int k,i;
		int s = 0;
		Scanner in = new Scanner(System.in);
		int n = Integer.parseInt(in.nextLine());
		int array[] = new int[n];
		for(i=0;i<n;i++)array[i] = Integer.parseInt(in.next());
		for (k=0;k<n;k++){
			if (isprime(array[k])){
				s++;
		}
	}
		System.out.println(s);
}

	public static boolean isprime(int x) {
		int i = 3;
		if (x == 2)
				return true;
		if (x < 2 || x % 2 == 0 )
				return false;
		while (i <= Math.sqrt(x)){
			if (x % i == 0){
				return false;
			}
			i = i+2;
		}
		return true;
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		int k,i;
		int s = 0;
		Scanner in = new Scanner(System.in);
		int n = Integer.parseInt(in.nextLine());
		int array[] = new int[n];
		for(i=0;i<n;i++)array[i] = Integer.parseInt(in.next());
		for (k=0;k<n;k++){
			if (isprime(array[k])){
				s++;
		}
	}
		System.out.println(s);
}

	public static boolean isprime(int x) {
		int i = 3;
		if (x == 2)
				return true;
		if (x < 2 || x % 2 == 0 )
				return false;
		while (i <= Math.sqrt(x)){
			if (x % i == 0){
				return false;
			}
			i = i+2;
		}
		return true;
	}
} Main public static void main(String[] args) {
		int k,i;
		int s = 0;
		Scanner in = new Scanner(System.in);
		int n = Integer.parseInt(in.nextLine());
		int array[] = new int[n];
		for(i=0;i<n;i++)array[i] = Integer.parseInt(in.next());
		for (k=0;k<n;k++){
			if (isprime(array[k])){
				s++;
		}
	}
		System.out.println(s);
} main {
		int k,i;
		int s = 0;
		Scanner in = new Scanner(System.in);
		int n = Integer.parseInt(in.nextLine());
		int array[] = new int[n];
		for(i=0;i<n;i++)array[i] = Integer.parseInt(in.next());
		for (k=0;k<n;k++){
			if (isprime(array[k])){
				s++;
		}
	}
		System.out.println(s);
} int k k i; i int s = 0; s 0 Scanner in = new Scanner(System.in); in new Scanner(System.in) int n = Integer.parseInt(in.nextLine()); n Integer.parseInt(in.nextLine()) Integer.parseInt Integer in.nextLine() in.nextLine in int array[] = new int[n]; array new int[n] n for(i=0;i<n;i++)array[i] = Integer.parseInt(in.next()); i=0; i=0 i 0 i<n i n i++ i++ i array[i] = Integer.parseInt(in.next()); array[i] = Integer.parseInt(in.next()) array[i] array i Integer.parseInt(in.next()) Integer.parseInt Integer in.next() in.next in for (k=0;k<n;k++){
			if (isprime(array[k])){
				s++;
		}
	} k=0; k=0 k 0 k<n k n k++ k++ k {
			if (isprime(array[k])){
				s++;
		}
	} {
			if (isprime(array[k])){
				s++;
		}
	} if (isprime(array[k])){
				s++;
		} isprime(array[k]) isprime array[k] array k {
				s++;
		} s++ s System.out.println(s) System.out.println System.out System System.out s String[] args args public static boolean isprime(int x) {
		int i = 3;
		if (x == 2)
				return true;
		if (x < 2 || x % 2 == 0 )
				return false;
		while (i <= Math.sqrt(x)){
			if (x % i == 0){
				return false;
			}
			i = i+2;
		}
		return true;
	} isprime {
		int i = 3;
		if (x == 2)
				return true;
		if (x < 2 || x % 2 == 0 )
				return false;
		while (i <= Math.sqrt(x)){
			if (x % i == 0){
				return false;
			}
			i = i+2;
		}
		return true;
	} int i = 3; i 3 if (x == 2)
				return true; x == 2 x 2 return true; true if (x < 2 || x % 2 == 0 )
				return false; x < 2 || x % 2 == 0 x < 2 x 2 x % 2 == 0 x % 2 x 2 0 return false; false while (i <= Math.sqrt(x)){
			if (x % i == 0){
				return false;
			}
			i = i+2;
		} i <= Math.sqrt(x) i Math.sqrt(x) Math.sqrt Math x {
			if (x % i == 0){
				return false;
			}
			i = i+2;
		} if (x % i == 0){
				return false;
			} x % i == 0 x % i x i 0 {
				return false;
			} return false; false i = i+2 i i+2 i 2 return true; true int x x public class Main {

	public static void main(String[] args) {
		int k,i;
		int s = 0;
		Scanner in = new Scanner(System.in);
		int n = Integer.parseInt(in.nextLine());
		int array[] = new int[n];
		for(i=0;i<n;i++)array[i] = Integer.parseInt(in.next());
		for (k=0;k<n;k++){
			if (isprime(array[k])){
				s++;
		}
	}
		System.out.println(s);
}

	public static boolean isprime(int x) {
		int i = 3;
		if (x == 2)
				return true;
		if (x < 2 || x % 2 == 0 )
				return false;
		while (i <= Math.sqrt(x)){
			if (x % i == 0){
				return false;
			}
			i = i+2;
		}
		return true;
	}
} public class Main {

	public static void main(String[] args) {
		int k,i;
		int s = 0;
		Scanner in = new Scanner(System.in);
		int n = Integer.parseInt(in.nextLine());
		int array[] = new int[n];
		for(i=0;i<n;i++)array[i] = Integer.parseInt(in.next());
		for (k=0;k<n;k++){
			if (isprime(array[k])){
				s++;
		}
	}
		System.out.println(s);
}

	public static boolean isprime(int x) {
		int i = 3;
		if (x == 2)
				return true;
		if (x < 2 || x % 2 == 0 )
				return false;
		while (i <= Math.sqrt(x)){
			if (x % i == 0){
				return false;
			}
			i = i+2;
		}
		return true;
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		int k,i;
		int s = 0;
		Scanner in = new Scanner(System.in);
		int n = Integer.parseInt(in.nextLine());
		int array[] = new int[n];
		for(i=0;i<n;i++)array[i] = Integer.parseInt(in.next());
		for (k=0;k<n;k++){
			if (isprime(array[k])){
				s++;
		}
	}
		System.out.println(s);
}

	public static boolean isprime(int x) {
		int i = 3;
		if (x == 2)
				return true;
		if (x < 2 || x % 2 == 0 )
				return false;
		while (i <= Math.sqrt(x)){
			if (x % i == 0){
				return false;
			}
			i = i+2;
		}
		return true;
	}
}