import java.util.Scanner;
class Main{
    static public void  main(String[] av){

        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();
        }
int sum=0;
        for (int j=0;j<n;j++){
           double len = Math.sqrt(a[j]);
for ( int i=2 ; i<=len;i++){
    if(a[j]%i==0){
        sum++;
        break;
    }

    }
}



System.out.println(n-sum);       
    }
    
} import java.util.Scanner; Scanner java.util class Main{
    static public void  main(String[] av){

        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();
        }
int sum=0;
        for (int j=0;j<n;j++){
           double len = Math.sqrt(a[j]);
for ( int i=2 ; i<=len;i++){
    if(a[j]%i==0){
        sum++;
        break;
    }

    }
}



System.out.println(n-sum);       
    }
    
} Main static public void  main(String[] av){

        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();
        }
int sum=0;
        for (int j=0;j<n;j++){
           double len = Math.sqrt(a[j]);
for ( int i=2 ; i<=len;i++){
    if(a[j]%i==0){
        sum++;
        break;
    }

    }
}



System.out.println(n-sum);       
    } 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();
        }
int sum=0;
        for (int j=0;j<n;j++){
           double len = Math.sqrt(a[j]);
for ( int i=2 ; i<=len;i++){
    if(a[j]%i==0){
        sum++;
        break;
    }

    }
}



System.out.println(n-sum);       
    } 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 int sum=0; sum 0 for (int j=0;j<n;j++){
           double len = Math.sqrt(a[j]);
for ( int i=2 ; i<=len;i++){
    if(a[j]%i==0){
        sum++;
        break;
    }

    }
} int j=0; int j=0; j 0 j<n j n j++ j++ j {
           double len = Math.sqrt(a[j]);
for ( int i=2 ; i<=len;i++){
    if(a[j]%i==0){
        sum++;
        break;
    }

    }
} {
           double len = Math.sqrt(a[j]);
for ( int i=2 ; i<=len;i++){
    if(a[j]%i==0){
        sum++;
        break;
    }

    }
} double len = Math.sqrt(a[j]); len Math.sqrt(a[j]) Math.sqrt Math a[j] a j for ( int i=2 ; i<=len;i++){
    if(a[j]%i==0){
        sum++;
        break;
    }

    } int i=2 ; int i=2 ; i 2 i<=len i len i++ i++ i {
    if(a[j]%i==0){
        sum++;
        break;
    }

    } {
    if(a[j]%i==0){
        sum++;
        break;
    }

    } if(a[j]%i==0){
        sum++;
        break;
    } a[j]%i==0 a[j]%i a[j] a j i 0 {
        sum++;
        break;
    } sum++ sum break; System.out.println(n-sum) System.out.println System.out System System.out n-sum n sum String[] av av
import java.util.Scanner;
class Main{
    static public void  main(String[] av){

        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();
        }
int sum=0;
        for (int j=0;j<n;j++){
           double len = Math.sqrt(a[j]);
for ( int i=2 ; i<=len;i++){
    if(a[j]%i==0){
        sum++;
        break;
    }

    }
}



System.out.println(n-sum);       
    }
    
}
