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

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

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