import java.io.*;
import java.util.*;



class Main{
    //読み込みのテンプレ(stringオブジェクトまで)
    
    static int number;
    static int[] linenumbers;
    
    
    public static void main(String[] args) throws IOException{
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        //Integer that shows the number of the lines
        String strnumber = reader.readLine();
        int number = Integer.parseInt(strnumber);
        
        //System.out.println(number);
        
        int[] linenumbers = new int[number];
        
        for(int i=0;i<number;i++){
            linenumbers[i] = Integer.parseInt((String)reader.readLine());
        }
        int prime_number=0;
        
        for(int i=0;i<linenumbers.length;i++){
            if(isPrime(linenumbers[i]))prime_number++;
        }
        
        System.out.println(prime_number);
    }
    
    public static boolean isPrime(int n){
        if(n==2)return true;
        else if(n%2==0)return false;
        else if(n<9)return true;
        else{
            for(int i =3;i*i<=n;i+=2){
                if(n%i==0)return false;
            }
            return true;
        
        }
    
    }
    
    
} import java.io.*; io.* java import java.util.*; util.* java class Main{
    //読み込みのテンプレ(stringオブジェクトまで)
    
    static int number;
    static int[] linenumbers;
    
    
    public static void main(String[] args) throws IOException{
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        //Integer that shows the number of the lines
        String strnumber = reader.readLine();
        int number = Integer.parseInt(strnumber);
        
        //System.out.println(number);
        
        int[] linenumbers = new int[number];
        
        for(int i=0;i<number;i++){
            linenumbers[i] = Integer.parseInt((String)reader.readLine());
        }
        int prime_number=0;
        
        for(int i=0;i<linenumbers.length;i++){
            if(isPrime(linenumbers[i]))prime_number++;
        }
        
        System.out.println(prime_number);
    }
    
    public static boolean isPrime(int n){
        if(n==2)return true;
        else if(n%2==0)return false;
        else if(n<9)return true;
        else{
            for(int i =3;i*i<=n;i+=2){
                if(n%i==0)return false;
            }
            return true;
        
        }
    
    }
    
    
} Main static int number; number static int[] linenumbers; linenumbers public static void main(String[] args) throws IOException{
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        //Integer that shows the number of the lines
        String strnumber = reader.readLine();
        int number = Integer.parseInt(strnumber);
        
        //System.out.println(number);
        
        int[] linenumbers = new int[number];
        
        for(int i=0;i<number;i++){
            linenumbers[i] = Integer.parseInt((String)reader.readLine());
        }
        int prime_number=0;
        
        for(int i=0;i<linenumbers.length;i++){
            if(isPrime(linenumbers[i]))prime_number++;
        }
        
        System.out.println(prime_number);
    } main {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        //Integer that shows the number of the lines
        String strnumber = reader.readLine();
        int number = Integer.parseInt(strnumber);
        
        //System.out.println(number);
        
        int[] linenumbers = new int[number];
        
        for(int i=0;i<number;i++){
            linenumbers[i] = Integer.parseInt((String)reader.readLine());
        }
        int prime_number=0;
        
        for(int i=0;i<linenumbers.length;i++){
            if(isPrime(linenumbers[i]))prime_number++;
        }
        
        System.out.println(prime_number);
    } BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); reader new BufferedReader(new InputStreamReader(System.in)) String strnumber = reader.readLine(); strnumber reader.readLine() reader.readLine reader int number = Integer.parseInt(strnumber); number Integer.parseInt(strnumber) Integer.parseInt Integer strnumber int[] linenumbers = new int[number]; linenumbers new int[number] number for(int i=0;i<number;i++){
            linenumbers[i] = Integer.parseInt((String)reader.readLine());
        } int i=0; int i=0; i 0 i<number i number i++ i++ i {
            linenumbers[i] = Integer.parseInt((String)reader.readLine());
        } {
            linenumbers[i] = Integer.parseInt((String)reader.readLine());
        } linenumbers[i] = Integer.parseInt((String)reader.readLine()) linenumbers[i] linenumbers i Integer.parseInt((String)reader.readLine()) Integer.parseInt Integer (String)reader.readLine() reader.readLine reader int prime_number=0; prime_number 0 for(int i=0;i<linenumbers.length;i++){
            if(isPrime(linenumbers[i]))prime_number++;
        } int i=0; int i=0; i 0 i<linenumbers.length i linenumbers.length linenumbers linenumbers.length i++ i++ i {
            if(isPrime(linenumbers[i]))prime_number++;
        } {
            if(isPrime(linenumbers[i]))prime_number++;
        } if(isPrime(linenumbers[i]))prime_number++; isPrime(linenumbers[i]) isPrime linenumbers[i] linenumbers i prime_number++ prime_number System.out.println(prime_number) System.out.println System.out System System.out prime_number String[] args args public static boolean isPrime(int n){
        if(n==2)return true;
        else if(n%2==0)return false;
        else if(n<9)return true;
        else{
            for(int i =3;i*i<=n;i+=2){
                if(n%i==0)return false;
            }
            return true;
        
        }
    
    } isPrime {
        if(n==2)return true;
        else if(n%2==0)return false;
        else if(n<9)return true;
        else{
            for(int i =3;i*i<=n;i+=2){
                if(n%i==0)return false;
            }
            return true;
        
        }
    
    } if(n==2)return true;
        else if(n%2==0)return false;
        else if(n<9)return true;
        else{
            for(int i =3;i*i<=n;i+=2){
                if(n%i==0)return false;
            }
            return true;
        
        } n==2 n 2 return true; true if(n%2==0)return false;
        else if(n<9)return true;
        else{
            for(int i =3;i*i<=n;i+=2){
                if(n%i==0)return false;
            }
            return true;
        
        } n%2==0 n%2 n 2 0 return false; false if(n<9)return true;
        else{
            for(int i =3;i*i<=n;i+=2){
                if(n%i==0)return false;
            }
            return true;
        
        } n<9 n 9 return true; true {
            for(int i =3;i*i<=n;i+=2){
                if(n%i==0)return false;
            }
            return true;
        
        } for(int i =3;i*i<=n;i+=2){
                if(n%i==0)return false;
            } int i =3; int i =3; i 3 i*i<=n i*i i i n i+=2 i+=2 i 2 {
                if(n%i==0)return false;
            } {
                if(n%i==0)return false;
            } if(n%i==0)return false; n%i==0 n%i n i 0 return false; false return true; true int n n
import java.io.*;
import java.util.*;



class Main{
    //読み込みのテンプレ(stringオブジェクトまで)
    
    static int number;
    static int[] linenumbers;
    
    
    public static void main(String[] args) throws IOException{
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        //Integer that shows the number of the lines
        String strnumber = reader.readLine();
        int number = Integer.parseInt(strnumber);
        
        //System.out.println(number);
        
        int[] linenumbers = new int[number];
        
        for(int i=0;i<number;i++){
            linenumbers[i] = Integer.parseInt((String)reader.readLine());
        }
        int prime_number=0;
        
        for(int i=0;i<linenumbers.length;i++){
            if(isPrime(linenumbers[i]))prime_number++;
        }
        
        System.out.println(prime_number);
    }
    
    public static boolean isPrime(int n){
        if(n==2)return true;
        else if(n%2==0)return false;
        else if(n<9)return true;
        else{
            for(int i =3;i*i<=n;i+=2){
                if(n%i==0)return false;
            }
            return true;
        
        }
    
    }
    
    
}