import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main{
    public static void main(String[] args) throws IOException{
        final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        final int n = Integer.parseInt(br.readLine());
        int ans = 0;
        for(int i = 0; i<n; i++){
            if(isPrime(Integer.parseInt(br.readLine()))) ans++;
        }
        System.out.println(ans);
    }
    private static boolean isPrime(int x){
        if(x<2) return false;
        if(x<=3) return true;
        if(x%2==0||x%3==0) return false;
        for(int i = 5; i*i<=x; i += 6){
            if(x%i==0||x%(i+2)==0) return false;
        }
        return true;
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io class Main{
    public static void main(String[] args) throws IOException{
        final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        final int n = Integer.parseInt(br.readLine());
        int ans = 0;
        for(int i = 0; i<n; i++){
            if(isPrime(Integer.parseInt(br.readLine()))) ans++;
        }
        System.out.println(ans);
    }
    private static boolean isPrime(int x){
        if(x<2) return false;
        if(x<=3) return true;
        if(x%2==0||x%3==0) return false;
        for(int i = 5; i*i<=x; i += 6){
            if(x%i==0||x%(i+2)==0) return false;
        }
        return true;
    }
} Main public static void main(String[] args) throws IOException{
        final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        final int n = Integer.parseInt(br.readLine());
        int ans = 0;
        for(int i = 0; i<n; i++){
            if(isPrime(Integer.parseInt(br.readLine()))) ans++;
        }
        System.out.println(ans);
    } main {
        final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        final int n = Integer.parseInt(br.readLine());
        int ans = 0;
        for(int i = 0; i<n; i++){
            if(isPrime(Integer.parseInt(br.readLine()))) ans++;
        }
        System.out.println(ans);
    } final BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) final int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int ans = 0; ans 0 for(int i = 0; i<n; i++){
            if(isPrime(Integer.parseInt(br.readLine()))) ans++;
        } int i = 0; int i = 0; i 0 i<n i n i++ i++ i {
            if(isPrime(Integer.parseInt(br.readLine()))) ans++;
        } {
            if(isPrime(Integer.parseInt(br.readLine()))) ans++;
        } if(isPrime(Integer.parseInt(br.readLine()))) ans++; isPrime(Integer.parseInt(br.readLine())) isPrime Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br ans++ ans System.out.println(ans) System.out.println System.out System System.out ans String[] args args private static boolean isPrime(int x){
        if(x<2) return false;
        if(x<=3) return true;
        if(x%2==0||x%3==0) return false;
        for(int i = 5; i*i<=x; i += 6){
            if(x%i==0||x%(i+2)==0) return false;
        }
        return true;
    } isPrime {
        if(x<2) return false;
        if(x<=3) return true;
        if(x%2==0||x%3==0) return false;
        for(int i = 5; i*i<=x; i += 6){
            if(x%i==0||x%(i+2)==0) return false;
        }
        return true;
    } if(x<2) return false; x<2 x 2 return false; false if(x<=3) return true; x<=3 x 3 return true; true if(x%2==0||x%3==0) return false; x%2==0||x%3==0 x%2==0 x%2 x 2 0 x%3==0 x%3 x 3 0 return false; false for(int i = 5; i*i<=x; i += 6){
            if(x%i==0||x%(i+2)==0) return false;
        } int i = 5; int i = 5; i 5 i*i<=x i*i i i x i += 6 i += 6 i 6 {
            if(x%i==0||x%(i+2)==0) return false;
        } {
            if(x%i==0||x%(i+2)==0) return false;
        } if(x%i==0||x%(i+2)==0) return false; x%i==0||x%(i+2)==0 x%i==0 x%i x i 0 x%(i+2)==0 x%(i+2) x (i+2) i 2 0 return false; false return true; true int x x
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main{
    public static void main(String[] args) throws IOException{
        final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        final int n = Integer.parseInt(br.readLine());
        int ans = 0;
        for(int i = 0; i<n; i++){
            if(isPrime(Integer.parseInt(br.readLine()))) ans++;
        }
        System.out.println(ans);
    }
    private static boolean isPrime(int x){
        if(x<2) return false;
        if(x<=3) return true;
        if(x%2==0||x%3==0) return false;
        for(int i = 5; i*i<=x; i += 6){
            if(x%i==0||x%(i+2)==0) return false;
        }
        return true;
    }
}