import java.util.Scanner;
public class Main {
	public static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int i, j, k;
		int n = sc.nextInt();
		int a[] = new int[n];
		int count = 0;
		
		for(i = 0; i < n; i++){
			a[i] = sc.nextInt();
			if(prime(a[i]) == 1) count++;
		}
		System.out.println(count);
		
		
	}
	
	public static int prime(int x){
		if(x == 2) return 1;
		if(x <= 1 || x % 2 == 0) return 0;
		int i = 3;
		
		while( i <= Math.sqrt(x)){
			if(x % i == 0) return 0;
			i = i + 2;
		}
		return 1;
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int i, j, k;
		int n = sc.nextInt();
		int a[] = new int[n];
		int count = 0;
		
		for(i = 0; i < n; i++){
			a[i] = sc.nextInt();
			if(prime(a[i]) == 1) count++;
		}
		System.out.println(count);
		
		
	}
	
	public static int prime(int x){
		if(x == 2) return 1;
		if(x <= 1 || x % 2 == 0) return 0;
		int i = 3;
		
		while( i <= Math.sqrt(x)){
			if(x % i == 0) return 0;
			i = i + 2;
		}
		return 1;
	}
} Main public static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {
		int i, j, k;
		int n = sc.nextInt();
		int a[] = new int[n];
		int count = 0;
		
		for(i = 0; i < n; i++){
			a[i] = sc.nextInt();
			if(prime(a[i]) == 1) count++;
		}
		System.out.println(count);
		
		
	} main {
		int i, j, k;
		int n = sc.nextInt();
		int a[] = new int[n];
		int count = 0;
		
		for(i = 0; i < n; i++){
			a[i] = sc.nextInt();
			if(prime(a[i]) == 1) count++;
		}
		System.out.println(count);
		
		
	} int i i j j k; k int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int a[] = new int[n]; a new int[n] n int count = 0; count 0 for(i = 0; i < n; i++){
			a[i] = sc.nextInt();
			if(prime(a[i]) == 1) count++;
		} i = 0; i = 0 i 0 i < n i n i++ i++ i {
			a[i] = sc.nextInt();
			if(prime(a[i]) == 1) count++;
		} {
			a[i] = sc.nextInt();
			if(prime(a[i]) == 1) count++;
		} a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc if(prime(a[i]) == 1) count++; prime(a[i]) == 1 prime(a[i]) prime a[i] a i 1 count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args public static int prime(int x){
		if(x == 2) return 1;
		if(x <= 1 || x % 2 == 0) return 0;
		int i = 3;
		
		while( i <= Math.sqrt(x)){
			if(x % i == 0) return 0;
			i = i + 2;
		}
		return 1;
	} prime {
		if(x == 2) return 1;
		if(x <= 1 || x % 2 == 0) return 0;
		int i = 3;
		
		while( i <= Math.sqrt(x)){
			if(x % i == 0) return 0;
			i = i + 2;
		}
		return 1;
	} if(x == 2) return 1; x == 2 x 2 return 1; 1 if(x <= 1 || x % 2 == 0) return 0; x <= 1 || x % 2 == 0 x <= 1 x 1 x % 2 == 0 x % 2 x 2 0 return 0; 0 int i = 3; i 3 while( i <= Math.sqrt(x)){
			if(x % i == 0) return 0;
			i = i + 2;
		} i <= Math.sqrt(x) i Math.sqrt(x) Math.sqrt Math x {
			if(x % i == 0) return 0;
			i = i + 2;
		} if(x % i == 0) return 0; x % i == 0 x % i x i 0 return 0; 0 i = i + 2 i i + 2 i 2 return 1; 1 int x x public class Main {
	public static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int i, j, k;
		int n = sc.nextInt();
		int a[] = new int[n];
		int count = 0;
		
		for(i = 0; i < n; i++){
			a[i] = sc.nextInt();
			if(prime(a[i]) == 1) count++;
		}
		System.out.println(count);
		
		
	}
	
	public static int prime(int x){
		if(x == 2) return 1;
		if(x <= 1 || x % 2 == 0) return 0;
		int i = 3;
		
		while( i <= Math.sqrt(x)){
			if(x % i == 0) return 0;
			i = i + 2;
		}
		return 1;
	}
} public class Main {
	public static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int i, j, k;
		int n = sc.nextInt();
		int a[] = new int[n];
		int count = 0;
		
		for(i = 0; i < n; i++){
			a[i] = sc.nextInt();
			if(prime(a[i]) == 1) count++;
		}
		System.out.println(count);
		
		
	}
	
	public static int prime(int x){
		if(x == 2) return 1;
		if(x <= 1 || x % 2 == 0) return 0;
		int i = 3;
		
		while( i <= Math.sqrt(x)){
			if(x % i == 0) return 0;
			i = i + 2;
		}
		return 1;
	}
} Main
import java.util.Scanner;
public class Main {
	public static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int i, j, k;
		int n = sc.nextInt();
		int a[] = new int[n];
		int count = 0;
		
		for(i = 0; i < n; i++){
			a[i] = sc.nextInt();
			if(prime(a[i]) == 1) count++;
		}
		System.out.println(count);
		
		
	}
	
	public static int prime(int x){
		if(x == 2) return 1;
		if(x <= 1 || x % 2 == 0) return 0;
		int i = 3;
		
		while( i <= Math.sqrt(x)){
			if(x % i == 0) return 0;
			i = i + 2;
		}
		return 1;
	}
}
