import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        int n = Integer.parseInt(sc.next());
        int count = 0;
        for(int i = 0; i < n; i++){
            if(isprime(Integer.parseInt(sc.next()))) count++;
        }
        System.out.println(count);
    }
    
    static boolean isprime(int x){
        if(x == 2) return true;
        if(x < 2 || x%2 == 0) return false;
        double sqrt = Math.sqrt(x+1);
        for(int i = 3; i <= sqrt; i += 2){
            if(x%i == 0) return false;
        }
        return true;
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        int n = Integer.parseInt(sc.next());
        int count = 0;
        for(int i = 0; i < n; i++){
            if(isprime(Integer.parseInt(sc.next()))) count++;
        }
        System.out.println(count);
    }
    
    static boolean isprime(int x){
        if(x == 2) return true;
        if(x < 2 || x%2 == 0) return false;
        double sqrt = Math.sqrt(x+1);
        for(int i = 3; i <= sqrt; i += 2){
            if(x%i == 0) return false;
        }
        return true;
    }
} Main public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        int n = Integer.parseInt(sc.next());
        int count = 0;
        for(int i = 0; i < n; i++){
            if(isprime(Integer.parseInt(sc.next()))) count++;
        }
        System.out.println(count);
    } main {
        
        Scanner sc = new Scanner(System.in);
        
        int n = Integer.parseInt(sc.next());
        int count = 0;
        for(int i = 0; i < n; i++){
            if(isprime(Integer.parseInt(sc.next()))) count++;
        }
        System.out.println(count);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int count = 0; count 0 for(int i = 0; i < n; i++){
            if(isprime(Integer.parseInt(sc.next()))) count++;
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            if(isprime(Integer.parseInt(sc.next()))) count++;
        } {
            if(isprime(Integer.parseInt(sc.next()))) count++;
        } if(isprime(Integer.parseInt(sc.next()))) count++; isprime(Integer.parseInt(sc.next())) isprime Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args static boolean isprime(int x){
        if(x == 2) return true;
        if(x < 2 || x%2 == 0) return false;
        double sqrt = Math.sqrt(x+1);
        for(int i = 3; i <= sqrt; i += 2){
            if(x%i == 0) return false;
        }
        return true;
    } isprime {
        if(x == 2) return true;
        if(x < 2 || x%2 == 0) return false;
        double sqrt = Math.sqrt(x+1);
        for(int i = 3; i <= sqrt; i += 2){
            if(x%i == 0) return false;
        }
        return true;
    } if(x == 2) return true; x == 2 x 2 return true; true if(x < 2 || x%2 == 0) return false; x < 2 || x%2 == 0 x < 2 x 2 x%2 == 0 x%2 x 2 0 return false; false double sqrt = Math.sqrt(x+1); sqrt Math.sqrt(x+1) Math.sqrt Math x+1 x 1 for(int i = 3; i <= sqrt; i += 2){
            if(x%i == 0) return false;
        } int i = 3; int i = 3; i 3 i <= sqrt i sqrt i += 2 i += 2 i 2 {
            if(x%i == 0) return false;
        } {
            if(x%i == 0) return false;
        } if(x%i == 0) return false; x%i == 0 x%i x i 0 return false; false return true; true int x x public class Main {

    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        int n = Integer.parseInt(sc.next());
        int count = 0;
        for(int i = 0; i < n; i++){
            if(isprime(Integer.parseInt(sc.next()))) count++;
        }
        System.out.println(count);
    }
    
    static boolean isprime(int x){
        if(x == 2) return true;
        if(x < 2 || x%2 == 0) return false;
        double sqrt = Math.sqrt(x+1);
        for(int i = 3; i <= sqrt; i += 2){
            if(x%i == 0) return false;
        }
        return true;
    }
} public class Main {

    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        int n = Integer.parseInt(sc.next());
        int count = 0;
        for(int i = 0; i < n; i++){
            if(isprime(Integer.parseInt(sc.next()))) count++;
        }
        System.out.println(count);
    }
    
    static boolean isprime(int x){
        if(x == 2) return true;
        if(x < 2 || x%2 == 0) return false;
        double sqrt = Math.sqrt(x+1);
        for(int i = 3; i <= sqrt; i += 2){
            if(x%i == 0) return false;
        }
        return true;
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        int n = Integer.parseInt(sc.next());
        int count = 0;
        for(int i = 0; i < n; i++){
            if(isprime(Integer.parseInt(sc.next()))) count++;
        }
        System.out.println(count);
    }
    
    static boolean isprime(int x){
        if(x == 2) return true;
        if(x < 2 || x%2 == 0) return false;
        double sqrt = Math.sqrt(x+1);
        for(int i = 3; i <= sqrt; i += 2){
            if(x%i == 0) return false;
        }
        return true;
    }
}
