import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
	// write your code here
        Scanner scanner =new Scanner(System.in);
        int n=scanner.nextInt();
        int[] ints=new int[99999999];
        boolean[] booleans=new boolean[99999999];
        for(int i=0;i<99999999;i++){
            ints[i]=i+2;
            booleans[i]=true;
        }
        for(int i=0;i<Math.sqrt(99999999)+1;i++){
            if(booleans[i]==false) continue;
            for(int j=(i+2)*2-2;j<99999999;j+=i+2){
                booleans[j]=false;
            }
        }
        int result=0;
        for(int i=0;i<n;i++){
            int x=scanner.nextInt();
            if(booleans[x-2]==true) result++;
        }
        System.out.println(result);
    }

}
 import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
	// write your code here
        Scanner scanner =new Scanner(System.in);
        int n=scanner.nextInt();
        int[] ints=new int[99999999];
        boolean[] booleans=new boolean[99999999];
        for(int i=0;i<99999999;i++){
            ints[i]=i+2;
            booleans[i]=true;
        }
        for(int i=0;i<Math.sqrt(99999999)+1;i++){
            if(booleans[i]==false) continue;
            for(int j=(i+2)*2-2;j<99999999;j+=i+2){
                booleans[j]=false;
            }
        }
        int result=0;
        for(int i=0;i<n;i++){
            int x=scanner.nextInt();
            if(booleans[x-2]==true) result++;
        }
        System.out.println(result);
    }

} Main public static void main(String[] args) {
	// write your code here
        Scanner scanner =new Scanner(System.in);
        int n=scanner.nextInt();
        int[] ints=new int[99999999];
        boolean[] booleans=new boolean[99999999];
        for(int i=0;i<99999999;i++){
            ints[i]=i+2;
            booleans[i]=true;
        }
        for(int i=0;i<Math.sqrt(99999999)+1;i++){
            if(booleans[i]==false) continue;
            for(int j=(i+2)*2-2;j<99999999;j+=i+2){
                booleans[j]=false;
            }
        }
        int result=0;
        for(int i=0;i<n;i++){
            int x=scanner.nextInt();
            if(booleans[x-2]==true) result++;
        }
        System.out.println(result);
    } main {
	// write your code here
        Scanner scanner =new Scanner(System.in);
        int n=scanner.nextInt();
        int[] ints=new int[99999999];
        boolean[] booleans=new boolean[99999999];
        for(int i=0;i<99999999;i++){
            ints[i]=i+2;
            booleans[i]=true;
        }
        for(int i=0;i<Math.sqrt(99999999)+1;i++){
            if(booleans[i]==false) continue;
            for(int j=(i+2)*2-2;j<99999999;j+=i+2){
                booleans[j]=false;
            }
        }
        int result=0;
        for(int i=0;i<n;i++){
            int x=scanner.nextInt();
            if(booleans[x-2]==true) result++;
        }
        System.out.println(result);
    } Scanner scanner =new Scanner(System.in); scanner new Scanner(System.in) int n=scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner int[] ints=new int[99999999]; ints new int[99999999] 99999999 boolean[] booleans=new boolean[99999999]; booleans new boolean[99999999] 99999999 for(int i=0;i<99999999;i++){
            ints[i]=i+2;
            booleans[i]=true;
        } int i=0; int i=0; i 0 i<99999999 i 99999999 i++ i++ i {
            ints[i]=i+2;
            booleans[i]=true;
        } {
            ints[i]=i+2;
            booleans[i]=true;
        } ints[i]=i+2 ints[i] ints i i+2 i 2 booleans[i]=true booleans[i] booleans i true for(int i=0;i<Math.sqrt(99999999)+1;i++){
            if(booleans[i]==false) continue;
            for(int j=(i+2)*2-2;j<99999999;j+=i+2){
                booleans[j]=false;
            }
        } int i=0; int i=0; i 0 i<Math.sqrt(99999999)+1 i Math.sqrt(99999999)+1 Math.sqrt(99999999) Math.sqrt Math 99999999 1 i++ i++ i {
            if(booleans[i]==false) continue;
            for(int j=(i+2)*2-2;j<99999999;j+=i+2){
                booleans[j]=false;
            }
        } {
            if(booleans[i]==false) continue;
            for(int j=(i+2)*2-2;j<99999999;j+=i+2){
                booleans[j]=false;
            }
        } if(booleans[i]==false) continue; booleans[i]==false booleans[i] booleans i false continue; for(int j=(i+2)*2-2;j<99999999;j+=i+2){
                booleans[j]=false;
            } int j=(i+2)*2-2; int j=(i+2)*2-2; j (i+2)*2-2 (i+2)*2 (i+2) i 2 2 2 j<99999999 j 99999999 j+=i+2 j+=i+2 j i+2 i 2 {
                booleans[j]=false;
            } {
                booleans[j]=false;
            } booleans[j]=false booleans[j] booleans j false int result=0; result 0 for(int i=0;i<n;i++){
            int x=scanner.nextInt();
            if(booleans[x-2]==true) result++;
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            int x=scanner.nextInt();
            if(booleans[x-2]==true) result++;
        } {
            int x=scanner.nextInt();
            if(booleans[x-2]==true) result++;
        } int x=scanner.nextInt(); x scanner.nextInt() scanner.nextInt scanner if(booleans[x-2]==true) result++; booleans[x-2]==true booleans[x-2] booleans x-2 x 2 true result++ result System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {

    public static void main(String[] args) {
	// write your code here
        Scanner scanner =new Scanner(System.in);
        int n=scanner.nextInt();
        int[] ints=new int[99999999];
        boolean[] booleans=new boolean[99999999];
        for(int i=0;i<99999999;i++){
            ints[i]=i+2;
            booleans[i]=true;
        }
        for(int i=0;i<Math.sqrt(99999999)+1;i++){
            if(booleans[i]==false) continue;
            for(int j=(i+2)*2-2;j<99999999;j+=i+2){
                booleans[j]=false;
            }
        }
        int result=0;
        for(int i=0;i<n;i++){
            int x=scanner.nextInt();
            if(booleans[x-2]==true) result++;
        }
        System.out.println(result);
    }

} public class Main {

    public static void main(String[] args) {
	// write your code here
        Scanner scanner =new Scanner(System.in);
        int n=scanner.nextInt();
        int[] ints=new int[99999999];
        boolean[] booleans=new boolean[99999999];
        for(int i=0;i<99999999;i++){
            ints[i]=i+2;
            booleans[i]=true;
        }
        for(int i=0;i<Math.sqrt(99999999)+1;i++){
            if(booleans[i]==false) continue;
            for(int j=(i+2)*2-2;j<99999999;j+=i+2){
                booleans[j]=false;
            }
        }
        int result=0;
        for(int i=0;i<n;i++){
            int x=scanner.nextInt();
            if(booleans[x-2]==true) result++;
        }
        System.out.println(result);
    }

} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
	// write your code here
        Scanner scanner =new Scanner(System.in);
        int n=scanner.nextInt();
        int[] ints=new int[99999999];
        boolean[] booleans=new boolean[99999999];
        for(int i=0;i<99999999;i++){
            ints[i]=i+2;
            booleans[i]=true;
        }
        for(int i=0;i<Math.sqrt(99999999)+1;i++){
            if(booleans[i]==false) continue;
            for(int j=(i+2)*2-2;j<99999999;j+=i+2){
                booleans[j]=false;
            }
        }
        int result=0;
        for(int i=0;i<n;i++){
            int x=scanner.nextInt();
            if(booleans[x-2]==true) result++;
        }
        System.out.println(result);
    }

}

