import java.util.*;

class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt(),count=0;
        for(int ii=0;ii<n;ii++){
            int k = sc.nextInt();
            boolean flg = true;
            for(int i=2;i<=Math.sqrt(k);i++){
                if(k%i==0){flg=false;break;}
            }
            if(flg){
                count++;
            }
        }
        System.out.println(count);
    }
} import java.util.*; util.* java class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt(),count=0;
        for(int ii=0;ii<n;ii++){
            int k = sc.nextInt();
            boolean flg = true;
            for(int i=2;i<=Math.sqrt(k);i++){
                if(k%i==0){flg=false;break;}
            }
            if(flg){
                count++;
            }
        }
        System.out.println(count);
    }
} Main public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt(),count=0;
        for(int ii=0;ii<n;ii++){
            int k = sc.nextInt();
            boolean flg = true;
            for(int i=2;i<=Math.sqrt(k);i++){
                if(k%i==0){flg=false;break;}
            }
            if(flg){
                count++;
            }
        }
        System.out.println(count);
    } main {
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt(),count=0;
        for(int ii=0;ii<n;ii++){
            int k = sc.nextInt();
            boolean flg = true;
            for(int i=2;i<=Math.sqrt(k);i++){
                if(k%i==0){flg=false;break;}
            }
            if(flg){
                count++;
            }
        }
        System.out.println(count);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n=sc.nextInt() n sc.nextInt() sc.nextInt sc count=0; count 0 for(int ii=0;ii<n;ii++){
            int k = sc.nextInt();
            boolean flg = true;
            for(int i=2;i<=Math.sqrt(k);i++){
                if(k%i==0){flg=false;break;}
            }
            if(flg){
                count++;
            }
        } int ii=0; int ii=0; ii 0 ii<n ii n ii++ ii++ ii {
            int k = sc.nextInt();
            boolean flg = true;
            for(int i=2;i<=Math.sqrt(k);i++){
                if(k%i==0){flg=false;break;}
            }
            if(flg){
                count++;
            }
        } {
            int k = sc.nextInt();
            boolean flg = true;
            for(int i=2;i<=Math.sqrt(k);i++){
                if(k%i==0){flg=false;break;}
            }
            if(flg){
                count++;
            }
        } int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc boolean flg = true; flg true for(int i=2;i<=Math.sqrt(k);i++){
                if(k%i==0){flg=false;break;}
            } int i=2; int i=2; i 2 i<=Math.sqrt(k) i Math.sqrt(k) Math.sqrt Math k i++ i++ i {
                if(k%i==0){flg=false;break;}
            } {
                if(k%i==0){flg=false;break;}
            } if(k%i==0){flg=false;break;} k%i==0 k%i k i 0 {flg=false;break;} flg=false flg false break; if(flg){
                count++;
            } flg {
                count++;
            } count++ count System.out.println(count) System.out.println System.out System System.out count String args[] args
import java.util.*;

class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt(),count=0;
        for(int ii=0;ii<n;ii++){
            int k = sc.nextInt();
            boolean flg = true;
            for(int i=2;i<=Math.sqrt(k);i++){
                if(k%i==0){flg=false;break;}
            }
            if(flg){
                count++;
            }
        }
        System.out.println(count);
    }
}
