import java.util.Scanner;



class Main {
    public static void main (String args[]) {
	Scanner sc = new Scanner(System.in);
	int n = sc.nextInt();
	int A[] = new int[n];
	int cnt = 0;
	for(int i = 0;i < n;i++){
	    A[i] = sc.nextInt();		
	}
	for(int i = 0;i < n;i++){
	     cnt+=Prime(A[i]);	    
	}
	System.out.println(cnt);
    }
    public static int Prime(int A){
	if(A == 1) return 0;
	else if(A == 2) return 1;
	else if(A % 2 == 0) return 0;/*ifかも*/
	for(int j = 3;j <= A / j;j+=2){
	    if(A % j == 0) return 0;
	}
	return 1;	    
    }
}













 import java.util.Scanner; Scanner java.util class Main {
    public static void main (String args[]) {
	Scanner sc = new Scanner(System.in);
	int n = sc.nextInt();
	int A[] = new int[n];
	int cnt = 0;
	for(int i = 0;i < n;i++){
	    A[i] = sc.nextInt();		
	}
	for(int i = 0;i < n;i++){
	     cnt+=Prime(A[i]);	    
	}
	System.out.println(cnt);
    }
    public static int Prime(int A){
	if(A == 1) return 0;
	else if(A == 2) return 1;
	else if(A % 2 == 0) return 0;/*ifかも*/
	for(int j = 3;j <= A / j;j+=2){
	    if(A % j == 0) return 0;
	}
	return 1;	    
    }
} Main public static void main (String args[]) {
	Scanner sc = new Scanner(System.in);
	int n = sc.nextInt();
	int A[] = new int[n];
	int cnt = 0;
	for(int i = 0;i < n;i++){
	    A[i] = sc.nextInt();		
	}
	for(int i = 0;i < n;i++){
	     cnt+=Prime(A[i]);	    
	}
	System.out.println(cnt);
    } main {
	Scanner sc = new Scanner(System.in);
	int n = sc.nextInt();
	int A[] = new int[n];
	int cnt = 0;
	for(int i = 0;i < n;i++){
	    A[i] = sc.nextInt();		
	}
	for(int i = 0;i < n;i++){
	     cnt+=Prime(A[i]);	    
	}
	System.out.println(cnt);
    } 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 int cnt = 0; cnt 0 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 for(int i = 0;i < n;i++){
	     cnt+=Prime(A[i]);	    
	} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
	     cnt+=Prime(A[i]);	    
	} {
	     cnt+=Prime(A[i]);	    
	} cnt+=Prime(A[i]) cnt Prime(A[i]) Prime A[i] A i System.out.println(cnt) System.out.println System.out System System.out cnt String args[] args public static int Prime(int A){
	if(A == 1) return 0;
	else if(A == 2) return 1;
	else if(A % 2 == 0) return 0;/*ifかも*/
	for(int j = 3;j <= A / j;j+=2){
	    if(A % j == 0) return 0;
	}
	return 1;	    
    } Prime {
	if(A == 1) return 0;
	else if(A == 2) return 1;
	else if(A % 2 == 0) return 0;/*ifかも*/
	for(int j = 3;j <= A / j;j+=2){
	    if(A % j == 0) return 0;
	}
	return 1;	    
    } if(A == 1) return 0;
	else if(A == 2) return 1;
	else if(A % 2 == 0) return 0;/*ifかも*/ A == 1 A 1 return 0; 0 if(A == 2) return 1;
	else if(A % 2 == 0) return 0;/*ifかも*/ A == 2 A 2 return 1; 1 if(A % 2 == 0) return 0;/*ifかも*/ A % 2 == 0 A % 2 A 2 0 return 0;/*ifかも*/ 0 for(int j = 3;j <= A / j;j+=2){
	    if(A % j == 0) return 0;
	} int j = 3; int j = 3; j 3 j <= A / j j A / j A j j+=2 j+=2 j 2 {
	    if(A % j == 0) return 0;
	} {
	    if(A % j == 0) return 0;
	} if(A % j == 0) return 0; A % j == 0 A % j A j 0 return 0; 0 return 1; 1 int A A
import java.util.Scanner;



class Main {
    public static void main (String args[]) {
	Scanner sc = new Scanner(System.in);
	int n = sc.nextInt();
	int A[] = new int[n];
	int cnt = 0;
	for(int i = 0;i < n;i++){
	    A[i] = sc.nextInt();		
	}
	for(int i = 0;i < n;i++){
	     cnt+=Prime(A[i]);	    
	}
	System.out.println(cnt);
    }
    public static int Prime(int A){
	if(A == 1) return 0;
	else if(A == 2) return 1;
	else if(A % 2 == 0) return 0;/*ifかも*/
	for(int j = 3;j <= A / j;j+=2){
	    if(A % j == 0) return 0;
	}
	return 1;	    
    }
}














