import java.io.*;

class Main {
    public static void main (String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int prime = 0;
        for (int i = 0; i < n; i++) {
            int element = Integer.parseInt(br.readLine());
            if (isPrime(element)) prime++;
        }
        System.out.println(prime);
    }

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

    static boolean isPrime (int n) {
        for (int i = 2; i*i <= n; i++) {
            if (n%i == 0) return false;
        }
        return true;
    }
} Main public static void main (String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int prime = 0;
        for (int i = 0; i < n; i++) {
            int element = Integer.parseInt(br.readLine());
            if (isPrime(element)) prime++;
        }
        System.out.println(prime);
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int prime = 0;
        for (int i = 0; i < n; i++) {
            int element = Integer.parseInt(br.readLine());
            if (isPrime(element)) prime++;
        }
        System.out.println(prime);
    } 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 prime = 0; prime 0 for (int i = 0; i < n; i++) {
            int element = Integer.parseInt(br.readLine());
            if (isPrime(element)) prime++;
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            int element = Integer.parseInt(br.readLine());
            if (isPrime(element)) prime++;
        } {
            int element = Integer.parseInt(br.readLine());
            if (isPrime(element)) prime++;
        } int element = Integer.parseInt(br.readLine()); element Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br if (isPrime(element)) prime++; isPrime(element) isPrime element prime++ prime System.out.println(prime) System.out.println System.out System System.out prime String[] args args static boolean isPrime (int n) {
        for (int i = 2; i*i <= n; i++) {
            if (n%i == 0) return false;
        }
        return true;
    } isPrime {
        for (int i = 2; i*i <= n; i++) {
            if (n%i == 0) return false;
        }
        return true;
    } for (int i = 2; i*i <= n; i++) {
            if (n%i == 0) return false;
        } int i = 2; int i = 2; i 2 i*i <= n i*i i i n i++ i++ i {
            if (n%i == 0) return false;
        } {
            if (n%i == 0) return false;
        } if (n%i == 0) return false; n%i == 0 n%i n i 0 return false; false return true; true int n n
import java.io.*;

class Main {
    public static void main (String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int prime = 0;
        for (int i = 0; i < n; i++) {
            int element = Integer.parseInt(br.readLine());
            if (isPrime(element)) prime++;
        }
        System.out.println(prime);
    }

    static boolean isPrime (int n) {
        for (int i = 2; i*i <= n; i++) {
            if (n%i == 0) return false;
        }
        return true;
    }
}