import java.io.*;
public class Main {
    public static void main(String[] args) throws IOException{
        BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
        int idx=Integer.parseInt(buf.readLine()); 
        int ans=0;
        for(int i=0;i<idx;i++){
            int x=Integer.parseInt(buf.readLine());
            int flg=0;
            
            if(x==2){
                flg=0;
            }else if(x%2==0 || x<2){
                flg=1;
            }else{
                double sqrt=Math.sqrt(x);
                for(int j=3;j<=sqrt;j+=2){
                    if(x%j==0){
                        flg=1;break;
                    }
                }
            }
            if(flg==0){
                ans++;
            }
        }
        System.out.println(ans);
    }
} import java.io.*; io.* java public class Main {
    public static void main(String[] args) throws IOException{
        BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
        int idx=Integer.parseInt(buf.readLine()); 
        int ans=0;
        for(int i=0;i<idx;i++){
            int x=Integer.parseInt(buf.readLine());
            int flg=0;
            
            if(x==2){
                flg=0;
            }else if(x%2==0 || x<2){
                flg=1;
            }else{
                double sqrt=Math.sqrt(x);
                for(int j=3;j<=sqrt;j+=2){
                    if(x%j==0){
                        flg=1;break;
                    }
                }
            }
            if(flg==0){
                ans++;
            }
        }
        System.out.println(ans);
    }
} Main public static void main(String[] args) throws IOException{
        BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
        int idx=Integer.parseInt(buf.readLine()); 
        int ans=0;
        for(int i=0;i<idx;i++){
            int x=Integer.parseInt(buf.readLine());
            int flg=0;
            
            if(x==2){
                flg=0;
            }else if(x%2==0 || x<2){
                flg=1;
            }else{
                double sqrt=Math.sqrt(x);
                for(int j=3;j<=sqrt;j+=2){
                    if(x%j==0){
                        flg=1;break;
                    }
                }
            }
            if(flg==0){
                ans++;
            }
        }
        System.out.println(ans);
    } main {
        BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
        int idx=Integer.parseInt(buf.readLine()); 
        int ans=0;
        for(int i=0;i<idx;i++){
            int x=Integer.parseInt(buf.readLine());
            int flg=0;
            
            if(x==2){
                flg=0;
            }else if(x%2==0 || x<2){
                flg=1;
            }else{
                double sqrt=Math.sqrt(x);
                for(int j=3;j<=sqrt;j+=2){
                    if(x%j==0){
                        flg=1;break;
                    }
                }
            }
            if(flg==0){
                ans++;
            }
        }
        System.out.println(ans);
    } BufferedReader buf=new BufferedReader(new InputStreamReader(System.in)); buf new BufferedReader(new InputStreamReader(System.in)) int idx=Integer.parseInt(buf.readLine()); idx Integer.parseInt(buf.readLine()) Integer.parseInt Integer buf.readLine() buf.readLine buf int ans=0; ans 0 for(int i=0;i<idx;i++){
            int x=Integer.parseInt(buf.readLine());
            int flg=0;
            
            if(x==2){
                flg=0;
            }else if(x%2==0 || x<2){
                flg=1;
            }else{
                double sqrt=Math.sqrt(x);
                for(int j=3;j<=sqrt;j+=2){
                    if(x%j==0){
                        flg=1;break;
                    }
                }
            }
            if(flg==0){
                ans++;
            }
        } int i=0; int i=0; i 0 i<idx i idx i++ i++ i {
            int x=Integer.parseInt(buf.readLine());
            int flg=0;
            
            if(x==2){
                flg=0;
            }else if(x%2==0 || x<2){
                flg=1;
            }else{
                double sqrt=Math.sqrt(x);
                for(int j=3;j<=sqrt;j+=2){
                    if(x%j==0){
                        flg=1;break;
                    }
                }
            }
            if(flg==0){
                ans++;
            }
        } {
            int x=Integer.parseInt(buf.readLine());
            int flg=0;
            
            if(x==2){
                flg=0;
            }else if(x%2==0 || x<2){
                flg=1;
            }else{
                double sqrt=Math.sqrt(x);
                for(int j=3;j<=sqrt;j+=2){
                    if(x%j==0){
                        flg=1;break;
                    }
                }
            }
            if(flg==0){
                ans++;
            }
        } int x=Integer.parseInt(buf.readLine()); x Integer.parseInt(buf.readLine()) Integer.parseInt Integer buf.readLine() buf.readLine buf int flg=0; flg 0 if(x==2){
                flg=0;
            }else if(x%2==0 || x<2){
                flg=1;
            }else{
                double sqrt=Math.sqrt(x);
                for(int j=3;j<=sqrt;j+=2){
                    if(x%j==0){
                        flg=1;break;
                    }
                }
            } x==2 x 2 {
                flg=0;
            } flg=0 flg 0 if(x%2==0 || x<2){
                flg=1;
            }else{
                double sqrt=Math.sqrt(x);
                for(int j=3;j<=sqrt;j+=2){
                    if(x%j==0){
                        flg=1;break;
                    }
                }
            } x%2==0 || x<2 x%2==0 x%2 x 2 0 x<2 x 2 {
                flg=1;
            } flg=1 flg 1 {
                double sqrt=Math.sqrt(x);
                for(int j=3;j<=sqrt;j+=2){
                    if(x%j==0){
                        flg=1;break;
                    }
                }
            } double sqrt=Math.sqrt(x); sqrt Math.sqrt(x) Math.sqrt Math x for(int j=3;j<=sqrt;j+=2){
                    if(x%j==0){
                        flg=1;break;
                    }
                } int j=3; int j=3; j 3 j<=sqrt j sqrt j+=2 j+=2 j 2 {
                    if(x%j==0){
                        flg=1;break;
                    }
                } {
                    if(x%j==0){
                        flg=1;break;
                    }
                } if(x%j==0){
                        flg=1;break;
                    } x%j==0 x%j x j 0 {
                        flg=1;break;
                    } flg=1 flg 1 break; if(flg==0){
                ans++;
            } flg==0 flg 0 {
                ans++;
            } ans++ ans System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
    public static void main(String[] args) throws IOException{
        BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
        int idx=Integer.parseInt(buf.readLine()); 
        int ans=0;
        for(int i=0;i<idx;i++){
            int x=Integer.parseInt(buf.readLine());
            int flg=0;
            
            if(x==2){
                flg=0;
            }else if(x%2==0 || x<2){
                flg=1;
            }else{
                double sqrt=Math.sqrt(x);
                for(int j=3;j<=sqrt;j+=2){
                    if(x%j==0){
                        flg=1;break;
                    }
                }
            }
            if(flg==0){
                ans++;
            }
        }
        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) throws IOException{
        BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
        int idx=Integer.parseInt(buf.readLine()); 
        int ans=0;
        for(int i=0;i<idx;i++){
            int x=Integer.parseInt(buf.readLine());
            int flg=0;
            
            if(x==2){
                flg=0;
            }else if(x%2==0 || x<2){
                flg=1;
            }else{
                double sqrt=Math.sqrt(x);
                for(int j=3;j<=sqrt;j+=2){
                    if(x%j==0){
                        flg=1;break;
                    }
                }
            }
            if(flg==0){
                ans++;
            }
        }
        System.out.println(ans);
    }
} Main
import java.io.*;
public class Main {
    public static void main(String[] args) throws IOException{
        BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
        int idx=Integer.parseInt(buf.readLine()); 
        int ans=0;
        for(int i=0;i<idx;i++){
            int x=Integer.parseInt(buf.readLine());
            int flg=0;
            
            if(x==2){
                flg=0;
            }else if(x%2==0 || x<2){
                flg=1;
            }else{
                double sqrt=Math.sqrt(x);
                for(int j=3;j<=sqrt;j+=2){
                    if(x%j==0){
                        flg=1;break;
                    }
                }
            }
            if(flg==0){
                ans++;
            }
        }
        System.out.println(ans);
    }
}