import java.util.Scanner;

public class Main{

	public static int prime(int a) {
		
		if( a == 0 || a == 1){
			return 0;
		}

		for (int i = 2; i <= Math.sqrt(a); i++) {
			
			if( a % i == 0){
				return 0;
			}

		}
		
		return 1;
	}

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int A[] = new int[n];

		for (int i = 0; i < n; i++) {
			A[i] = sc.nextInt();
		}
		sc.close();
		
		int c = 0;
		
		for( int i = 0; i < n; i++){
			c += prime(A[i]);
		}
		
		System.out.println(c);

	}

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

	public static int prime(int a) {
		
		if( a == 0 || a == 1){
			return 0;
		}

		for (int i = 2; i <= Math.sqrt(a); i++) {
			
			if( a % i == 0){
				return 0;
			}

		}
		
		return 1;
	}

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int A[] = new int[n];

		for (int i = 0; i < n; i++) {
			A[i] = sc.nextInt();
		}
		sc.close();
		
		int c = 0;
		
		for( int i = 0; i < n; i++){
			c += prime(A[i]);
		}
		
		System.out.println(c);

	}

} Main public static int prime(int a) {
		
		if( a == 0 || a == 1){
			return 0;
		}

		for (int i = 2; i <= Math.sqrt(a); i++) {
			
			if( a % i == 0){
				return 0;
			}

		}
		
		return 1;
	} prime {
		
		if( a == 0 || a == 1){
			return 0;
		}

		for (int i = 2; i <= Math.sqrt(a); i++) {
			
			if( a % i == 0){
				return 0;
			}

		}
		
		return 1;
	} if( a == 0 || a == 1){
			return 0;
		} a == 0 || a == 1 a == 0 a 0 a == 1 a 1 {
			return 0;
		} return 0; 0 for (int i = 2; i <= Math.sqrt(a); i++) {
			
			if( a % i == 0){
				return 0;
			}

		} int i = 2; int i = 2; i 2 i <= Math.sqrt(a) i Math.sqrt(a) Math.sqrt Math a i++ i++ i {
			
			if( a % i == 0){
				return 0;
			}

		} {
			
			if( a % i == 0){
				return 0;
			}

		} if( a % i == 0){
				return 0;
			} a % i == 0 a % i a i 0 {
				return 0;
			} return 0; 0 return 1; 1 int a a public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int A[] = new int[n];

		for (int i = 0; i < n; i++) {
			A[i] = sc.nextInt();
		}
		sc.close();
		
		int c = 0;
		
		for( int i = 0; i < n; i++){
			c += prime(A[i]);
		}
		
		System.out.println(c);

	} main {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int A[] = new int[n];

		for (int i = 0; i < n; i++) {
			A[i] = sc.nextInt();
		}
		sc.close();
		
		int c = 0;
		
		for( int i = 0; i < n; i++){
			c += prime(A[i]);
		}
		
		System.out.println(c);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int A[] = new int[n]; A new int[n] n for (int i = 0; i < n; i++) {
			A[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			A[i] = sc.nextInt();
		} {
			A[i] = sc.nextInt();
		} A[i] = sc.nextInt() A[i] A i sc.nextInt() sc.nextInt sc sc.close() sc.close sc int c = 0; c 0 for( int i = 0; i < n; i++){
			c += prime(A[i]);
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			c += prime(A[i]);
		} {
			c += prime(A[i]);
		} c += prime(A[i]) c prime(A[i]) prime A[i] A i System.out.println(c) System.out.println System.out System System.out c String[] args args public class Main{

	public static int prime(int a) {
		
		if( a == 0 || a == 1){
			return 0;
		}

		for (int i = 2; i <= Math.sqrt(a); i++) {
			
			if( a % i == 0){
				return 0;
			}

		}
		
		return 1;
	}

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int A[] = new int[n];

		for (int i = 0; i < n; i++) {
			A[i] = sc.nextInt();
		}
		sc.close();
		
		int c = 0;
		
		for( int i = 0; i < n; i++){
			c += prime(A[i]);
		}
		
		System.out.println(c);

	}

} public class Main{

	public static int prime(int a) {
		
		if( a == 0 || a == 1){
			return 0;
		}

		for (int i = 2; i <= Math.sqrt(a); i++) {
			
			if( a % i == 0){
				return 0;
			}

		}
		
		return 1;
	}

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int A[] = new int[n];

		for (int i = 0; i < n; i++) {
			A[i] = sc.nextInt();
		}
		sc.close();
		
		int c = 0;
		
		for( int i = 0; i < n; i++){
			c += prime(A[i]);
		}
		
		System.out.println(c);

	}

} Main
import java.util.Scanner;

public class Main{

	public static int prime(int a) {
		
		if( a == 0 || a == 1){
			return 0;
		}

		for (int i = 2; i <= Math.sqrt(a); i++) {
			
			if( a % i == 0){
				return 0;
			}

		}
		
		return 1;
	}

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int A[] = new int[n];

		for (int i = 0; i < n; i++) {
			A[i] = sc.nextInt();
		}
		sc.close();
		
		int c = 0;
		
		for( int i = 0; i < n; i++){
			c += prime(A[i]);
		}
		
		System.out.println(c);

	}

}

