import java.util.Scanner;
    
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.nextLine());
        
        int cnt = 0;
        for(int i = 0; i < n; i++){
            int x = Integer.parseInt(scanner.nextLine());
            if(isPrime(x)){
                cnt++;
            }
        }
        
        System.out.println(cnt);
    }
    
    public static boolean isPrime(int x) {
        if(x == 2){
            return true;
        }
        if(x < 2 || x % 2 == 0){
            return false;
        }

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

        int i = 3;
        while( i <= Math.sqrt(x) ){
            if(x % i == 0){
                return false;
            }
            i = i + 2;
        }
        return true;
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.nextLine());
        
        int cnt = 0;
        for(int i = 0; i < n; i++){
            int x = Integer.parseInt(scanner.nextLine());
            if(isPrime(x)){
                cnt++;
            }
        }
        
        System.out.println(cnt);
    } main {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.nextLine());
        
        int cnt = 0;
        for(int i = 0; i < n; i++){
            int x = Integer.parseInt(scanner.nextLine());
            if(isPrime(x)){
                cnt++;
            }
        }
        
        System.out.println(cnt);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = Integer.parseInt(scanner.nextLine()); n Integer.parseInt(scanner.nextLine()) Integer.parseInt Integer scanner.nextLine() scanner.nextLine scanner int cnt = 0; cnt 0 for(int i = 0; i < n; i++){
            int x = Integer.parseInt(scanner.nextLine());
            if(isPrime(x)){
                cnt++;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            int x = Integer.parseInt(scanner.nextLine());
            if(isPrime(x)){
                cnt++;
            }
        } {
            int x = Integer.parseInt(scanner.nextLine());
            if(isPrime(x)){
                cnt++;
            }
        } int x = Integer.parseInt(scanner.nextLine()); x Integer.parseInt(scanner.nextLine()) Integer.parseInt Integer scanner.nextLine() scanner.nextLine scanner if(isPrime(x)){
                cnt++;
            } isPrime(x) isPrime x {
                cnt++;
            } cnt++ cnt System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args public static boolean isPrime(int x) {
        if(x == 2){
            return true;
        }
        if(x < 2 || x % 2 == 0){
            return false;
        }

        int i = 3;
        while( i <= Math.sqrt(x) ){
            if(x % i == 0){
                return false;
            }
            i = i + 2;
        }
        return true;
    } isPrime {
        if(x == 2){
            return true;
        }
        if(x < 2 || x % 2 == 0){
            return false;
        }

        int i = 3;
        while( i <= Math.sqrt(x) ){
            if(x % i == 0){
                return false;
            }
            i = i + 2;
        }
        return true;
    } if(x == 2){
            return true;
        } x == 2 x 2 {
            return true;
        } 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;
        } return false; false int i = 3; i 3 while( i <= Math.sqrt(x) ){
            if(x % i == 0){
                return false;
            }
            i = i + 2;
        } i <= Math.sqrt(x) i Math.sqrt(x) Math.sqrt Math x {
            if(x % i == 0){
                return false;
            }
            i = i + 2;
        } if(x % i == 0){
                return false;
            } x % i == 0 x % i x i 0 {
                return false;
            } return false; false i = i + 2 i i + 2 i 2 return true; true int x x public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.nextLine());
        
        int cnt = 0;
        for(int i = 0; i < n; i++){
            int x = Integer.parseInt(scanner.nextLine());
            if(isPrime(x)){
                cnt++;
            }
        }
        
        System.out.println(cnt);
    }
    
    public static boolean isPrime(int x) {
        if(x == 2){
            return true;
        }
        if(x < 2 || x % 2 == 0){
            return false;
        }

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

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

        int i = 3;
        while( i <= Math.sqrt(x) ){
            if(x % i == 0){
                return false;
            }
            i = i + 2;
        }
        return true;
    }
}

