import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int i, j, n = scanner.nextInt();
        int count = 0;
        
        for(i = 0; i < n; ++i){
            int input = scanner.nextInt();
            int root = (int)Math.sqrt(input);
            for(j = 2; j <= root; ++j) if(input%j == 0) break;
            if(j == root + 1 || input == 2) ++count;
        } 
        System.out.println(count);
        scanner.close();
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int i, j, n = scanner.nextInt();
        int count = 0;
        
        for(i = 0; i < n; ++i){
            int input = scanner.nextInt();
            int root = (int)Math.sqrt(input);
            for(j = 2; j <= root; ++j) if(input%j == 0) break;
            if(j == root + 1 || input == 2) ++count;
        } 
        System.out.println(count);
        scanner.close();
    }
} Main public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int i, j, n = scanner.nextInt();
        int count = 0;
        
        for(i = 0; i < n; ++i){
            int input = scanner.nextInt();
            int root = (int)Math.sqrt(input);
            for(j = 2; j <= root; ++j) if(input%j == 0) break;
            if(j == root + 1 || input == 2) ++count;
        } 
        System.out.println(count);
        scanner.close();
    } main {
        Scanner scanner = new Scanner(System.in);
        int i, j, n = scanner.nextInt();
        int count = 0;
        
        for(i = 0; i < n; ++i){
            int input = scanner.nextInt();
            int root = (int)Math.sqrt(input);
            for(j = 2; j <= root; ++j) if(input%j == 0) break;
            if(j == root + 1 || input == 2) ++count;
        } 
        System.out.println(count);
        scanner.close();
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int i i j j n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner int count = 0; count 0 for(i = 0; i < n; ++i){
            int input = scanner.nextInt();
            int root = (int)Math.sqrt(input);
            for(j = 2; j <= root; ++j) if(input%j == 0) break;
            if(j == root + 1 || input == 2) ++count;
        } i = 0; i = 0 i 0 i < n i n ++i ++i i {
            int input = scanner.nextInt();
            int root = (int)Math.sqrt(input);
            for(j = 2; j <= root; ++j) if(input%j == 0) break;
            if(j == root + 1 || input == 2) ++count;
        } {
            int input = scanner.nextInt();
            int root = (int)Math.sqrt(input);
            for(j = 2; j <= root; ++j) if(input%j == 0) break;
            if(j == root + 1 || input == 2) ++count;
        } int input = scanner.nextInt(); input scanner.nextInt() scanner.nextInt scanner int root = (int)Math.sqrt(input); root (int)Math.sqrt(input) Math.sqrt Math input for(j = 2; j <= root; ++j) if(input%j == 0) break; j = 2; j = 2 j 2 j <= root j root ++j ++j j if(input%j == 0) break; if(input%j == 0) break; input%j == 0 input%j input j 0 break; if(j == root + 1 || input == 2) ++count; j == root + 1 || input == 2 j == root + 1 j root + 1 root 1 input == 2 input 2 ++count count System.out.println(count) System.out.println System.out System System.out count scanner.close() scanner.close scanner String[] args args public class Main {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int i, j, n = scanner.nextInt();
        int count = 0;
        
        for(i = 0; i < n; ++i){
            int input = scanner.nextInt();
            int root = (int)Math.sqrt(input);
            for(j = 2; j <= root; ++j) if(input%j == 0) break;
            if(j == root + 1 || input == 2) ++count;
        } 
        System.out.println(count);
        scanner.close();
    }
} public class Main {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int i, j, n = scanner.nextInt();
        int count = 0;
        
        for(i = 0; i < n; ++i){
            int input = scanner.nextInt();
            int root = (int)Math.sqrt(input);
            for(j = 2; j <= root; ++j) if(input%j == 0) break;
            if(j == root + 1 || input == 2) ++count;
        } 
        System.out.println(count);
        scanner.close();
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int i, j, n = scanner.nextInt();
        int count = 0;
        
        for(i = 0; i < n; ++i){
            int input = scanner.nextInt();
            int root = (int)Math.sqrt(input);
            for(j = 2; j <= root; ++j) if(input%j == 0) break;
            if(j == root + 1 || input == 2) ++count;
        } 
        System.out.println(count);
        scanner.close();
    }
}
