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

public class Main {
    private static final int SIZE = 10000000;

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        ArrayList<Integer> primeList = new ArrayList<Integer>(SIZE);
        createPrime(primeList);
        int n = Integer.parseInt(br.readLine());
        int count = 0;
        for (int i = 0; i < n; i++) {
            int p = Integer.parseInt(br.readLine());
            if (prime(p, primeList)) {
                count++;
            }
        }
        System.out.println(count);
    }

    static boolean prime(int n, ArrayList<Integer> primeList) {
        if (n <= 1000000) {
            for (int i = 0; primeList.get(i) * primeList.get(i) <= n; i++) {
                // ????±??????°??????????????\????????¨???????´???°??§????????????
                if (0 == n % primeList.get(i)) { //???????????????????´???°??§?????????
                    return false;
                }
            }
            return true;
        } else {
            for (int i = 0; primeList.get(i) * primeList.get(i) <= 1000000; i++) {
                // ????±??????°??????????????\????????¨???????´???°??§????????????
                if (0 == n % primeList.get(i)) { //???????????????????´???°??§?????????
                    return false;
                }
            }
            for (int i = 3; i * i <= n; i += 2) {
                if (n % i == 0) {
                    return false;
                }
            }
            return true;
        }
    }

    public static void createPrime(ArrayList<Integer> primeList) {
        int n = 1000000;
        primeList.add(2);
        primeList.add(3);
        for (int i = 5; i <= n; i += 2) { //????±?????\???°??????
            boolean wflag = false; //???????????????????????????
            for (int j = 1; primeList.get(j) * primeList.get(j) <= i; j++) {
                // ????±??????°??????????????\????????¨???????´???°??§????????????
                if (0 == i % primeList.get(j)) { //???????????????????´???°??§?????????
                    wflag = true;
                    break;
                }
            }
            if (!wflag) { //???????????§????????????????????£??????
                primeList.add(i); //?´???°??¨????????°????????????
            }
        }
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util public class Main {
    private static final int SIZE = 10000000;

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        ArrayList<Integer> primeList = new ArrayList<Integer>(SIZE);
        createPrime(primeList);
        int n = Integer.parseInt(br.readLine());
        int count = 0;
        for (int i = 0; i < n; i++) {
            int p = Integer.parseInt(br.readLine());
            if (prime(p, primeList)) {
                count++;
            }
        }
        System.out.println(count);
    }

    static boolean prime(int n, ArrayList<Integer> primeList) {
        if (n <= 1000000) {
            for (int i = 0; primeList.get(i) * primeList.get(i) <= n; i++) {
                // ????±??????°??????????????\????????¨???????´???°??§????????????
                if (0 == n % primeList.get(i)) { //???????????????????´???°??§?????????
                    return false;
                }
            }
            return true;
        } else {
            for (int i = 0; primeList.get(i) * primeList.get(i) <= 1000000; i++) {
                // ????±??????°??????????????\????????¨???????´???°??§????????????
                if (0 == n % primeList.get(i)) { //???????????????????´???°??§?????????
                    return false;
                }
            }
            for (int i = 3; i * i <= n; i += 2) {
                if (n % i == 0) {
                    return false;
                }
            }
            return true;
        }
    }

    public static void createPrime(ArrayList<Integer> primeList) {
        int n = 1000000;
        primeList.add(2);
        primeList.add(3);
        for (int i = 5; i <= n; i += 2) { //????±?????\???°??????
            boolean wflag = false; //???????????????????????????
            for (int j = 1; primeList.get(j) * primeList.get(j) <= i; j++) {
                // ????±??????°??????????????\????????¨???????´???°??§????????????
                if (0 == i % primeList.get(j)) { //???????????????????´???°??§?????????
                    wflag = true;
                    break;
                }
            }
            if (!wflag) { //???????????§????????????????????£??????
                primeList.add(i); //?´???°??¨????????°????????????
            }
        }
    }
} Main private static final int SIZE = 10000000; SIZE 10000000 public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        ArrayList<Integer> primeList = new ArrayList<Integer>(SIZE);
        createPrime(primeList);
        int n = Integer.parseInt(br.readLine());
        int count = 0;
        for (int i = 0; i < n; i++) {
            int p = Integer.parseInt(br.readLine());
            if (prime(p, primeList)) {
                count++;
            }
        }
        System.out.println(count);
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        ArrayList<Integer> primeList = new ArrayList<Integer>(SIZE);
        createPrime(primeList);
        int n = Integer.parseInt(br.readLine());
        int count = 0;
        for (int i = 0; i < n; i++) {
            int p = Integer.parseInt(br.readLine());
            if (prime(p, primeList)) {
                count++;
            }
        }
        System.out.println(count);
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) ArrayList<Integer> primeList = new ArrayList<Integer>(SIZE); primeList new ArrayList<Integer>(SIZE) createPrime(primeList) createPrime primeList int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int count = 0; count 0 for (int i = 0; i < n; i++) {
            int p = Integer.parseInt(br.readLine());
            if (prime(p, primeList)) {
                count++;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            int p = Integer.parseInt(br.readLine());
            if (prime(p, primeList)) {
                count++;
            }
        } {
            int p = Integer.parseInt(br.readLine());
            if (prime(p, primeList)) {
                count++;
            }
        } int p = Integer.parseInt(br.readLine()); p Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br if (prime(p, primeList)) {
                count++;
            } prime(p, primeList) prime p primeList {
                count++;
            } count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args static boolean prime(int n, ArrayList<Integer> primeList) {
        if (n <= 1000000) {
            for (int i = 0; primeList.get(i) * primeList.get(i) <= n; i++) {
                // ????±??????°??????????????\????????¨???????´???°??§????????????
                if (0 == n % primeList.get(i)) { //???????????????????´???°??§?????????
                    return false;
                }
            }
            return true;
        } else {
            for (int i = 0; primeList.get(i) * primeList.get(i) <= 1000000; i++) {
                // ????±??????°??????????????\????????¨???????´???°??§????????????
                if (0 == n % primeList.get(i)) { //???????????????????´???°??§?????????
                    return false;
                }
            }
            for (int i = 3; i * i <= n; i += 2) {
                if (n % i == 0) {
                    return false;
                }
            }
            return true;
        }
    } prime {
        if (n <= 1000000) {
            for (int i = 0; primeList.get(i) * primeList.get(i) <= n; i++) {
                // ????±??????°??????????????\????????¨???????´???°??§????????????
                if (0 == n % primeList.get(i)) { //???????????????????´???°??§?????????
                    return false;
                }
            }
            return true;
        } else {
            for (int i = 0; primeList.get(i) * primeList.get(i) <= 1000000; i++) {
                // ????±??????°??????????????\????????¨???????´???°??§????????????
                if (0 == n % primeList.get(i)) { //???????????????????´???°??§?????????
                    return false;
                }
            }
            for (int i = 3; i * i <= n; i += 2) {
                if (n % i == 0) {
                    return false;
                }
            }
            return true;
        }
    } if (n <= 1000000) {
            for (int i = 0; primeList.get(i) * primeList.get(i) <= n; i++) {
                // ????±??????°??????????????\????????¨???????´???°??§????????????
                if (0 == n % primeList.get(i)) { //???????????????????´???°??§?????????
                    return false;
                }
            }
            return true;
        } else {
            for (int i = 0; primeList.get(i) * primeList.get(i) <= 1000000; i++) {
                // ????±??????°??????????????\????????¨???????´???°??§????????????
                if (0 == n % primeList.get(i)) { //???????????????????´???°??§?????????
                    return false;
                }
            }
            for (int i = 3; i * i <= n; i += 2) {
                if (n % i == 0) {
                    return false;
                }
            }
            return true;
        } n <= 1000000 n 1000000 {
            for (int i = 0; primeList.get(i) * primeList.get(i) <= n; i++) {
                // ????±??????°??????????????\????????¨???????´???°??§????????????
                if (0 == n % primeList.get(i)) { //???????????????????´???°??§?????????
                    return false;
                }
            }
            return true;
        } for (int i = 0; primeList.get(i) * primeList.get(i) <= n; i++) {
                // ????±??????°??????????????\????????¨???????´???°??§????????????
                if (0 == n % primeList.get(i)) { //???????????????????´???°??§?????????
                    return false;
                }
            } int i = 0; int i = 0; i 0 primeList.get(i) * primeList.get(i) <= n primeList.get(i) * primeList.get(i) primeList.get(i) primeList.get primeList i primeList.get(i) primeList.get primeList i n i++ i++ i {
                // ????±??????°??????????????\????????¨???????´???°??§????????????
                if (0 == n % primeList.get(i)) { //???????????????????´???°??§?????????
                    return false;
                }
            } {
                // ????±??????°??????????????\????????¨???????´???°??§????????????
                if (0 == n % primeList.get(i)) { //???????????????????´???°??§?????????
                    return false;
                }
            } if (0 == n % primeList.get(i)) { //???????????????????´???°??§?????????
                    return false;
                } 0 == n % primeList.get(i) 0 n % primeList.get(i) n primeList.get(i) primeList.get primeList i { //???????????????????´???°??§?????????
                    return false;
                } return false; false return true; true {
            for (int i = 0; primeList.get(i) * primeList.get(i) <= 1000000; i++) {
                // ????±??????°??????????????\????????¨???????´???°??§????????????
                if (0 == n % primeList.get(i)) { //???????????????????´???°??§?????????
                    return false;
                }
            }
            for (int i = 3; i * i <= n; i += 2) {
                if (n % i == 0) {
                    return false;
                }
            }
            return true;
        } for (int i = 0; primeList.get(i) * primeList.get(i) <= 1000000; i++) {
                // ????±??????°??????????????\????????¨???????´???°??§????????????
                if (0 == n % primeList.get(i)) { //???????????????????´???°??§?????????
                    return false;
                }
            } int i = 0; int i = 0; i 0 primeList.get(i) * primeList.get(i) <= 1000000 primeList.get(i) * primeList.get(i) primeList.get(i) primeList.get primeList i primeList.get(i) primeList.get primeList i 1000000 i++ i++ i {
                // ????±??????°??????????????\????????¨???????´???°??§????????????
                if (0 == n % primeList.get(i)) { //???????????????????´???°??§?????????
                    return false;
                }
            } {
                // ????±??????°??????????????\????????¨???????´???°??§????????????
                if (0 == n % primeList.get(i)) { //???????????????????´???°??§?????????
                    return false;
                }
            } if (0 == n % primeList.get(i)) { //???????????????????´???°??§?????????
                    return false;
                } 0 == n % primeList.get(i) 0 n % primeList.get(i) n primeList.get(i) primeList.get primeList i { //???????????????????´???°??§?????????
                    return false;
                } return false; false for (int i = 3; i * i <= n; i += 2) {
                if (n % i == 0) {
                    return false;
                }
            } int i = 3; int i = 3; i 3 i * i <= n i * i i i n i += 2 i += 2 i 2 {
                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;
                } return false; false return true; true int n n ArrayList<Integer> primeList primeList public static void createPrime(ArrayList<Integer> primeList) {
        int n = 1000000;
        primeList.add(2);
        primeList.add(3);
        for (int i = 5; i <= n; i += 2) { //????±?????\???°??????
            boolean wflag = false; //???????????????????????????
            for (int j = 1; primeList.get(j) * primeList.get(j) <= i; j++) {
                // ????±??????°??????????????\????????¨???????´???°??§????????????
                if (0 == i % primeList.get(j)) { //???????????????????´???°??§?????????
                    wflag = true;
                    break;
                }
            }
            if (!wflag) { //???????????§????????????????????£??????
                primeList.add(i); //?´???°??¨????????°????????????
            }
        }
    } createPrime {
        int n = 1000000;
        primeList.add(2);
        primeList.add(3);
        for (int i = 5; i <= n; i += 2) { //????±?????\???°??????
            boolean wflag = false; //???????????????????????????
            for (int j = 1; primeList.get(j) * primeList.get(j) <= i; j++) {
                // ????±??????°??????????????\????????¨???????´???°??§????????????
                if (0 == i % primeList.get(j)) { //???????????????????´???°??§?????????
                    wflag = true;
                    break;
                }
            }
            if (!wflag) { //???????????§????????????????????£??????
                primeList.add(i); //?´???°??¨????????°????????????
            }
        }
    } int n = 1000000; n 1000000 primeList.add(2) primeList.add primeList 2 primeList.add(3) primeList.add primeList 3 for (int i = 5; i <= n; i += 2) { //????±?????\???°??????
            boolean wflag = false; //???????????????????????????
            for (int j = 1; primeList.get(j) * primeList.get(j) <= i; j++) {
                // ????±??????°??????????????\????????¨???????´???°??§????????????
                if (0 == i % primeList.get(j)) { //???????????????????´???°??§?????????
                    wflag = true;
                    break;
                }
            }
            if (!wflag) { //???????????§????????????????????£??????
                primeList.add(i); //?´???°??¨????????°????????????
            }
        } int i = 5; int i = 5; i 5 i <= n i n i += 2 i += 2 i 2 { //????±?????\???°??????
            boolean wflag = false; //???????????????????????????
            for (int j = 1; primeList.get(j) * primeList.get(j) <= i; j++) {
                // ????±??????°??????????????\????????¨???????´???°??§????????????
                if (0 == i % primeList.get(j)) { //???????????????????´???°??§?????????
                    wflag = true;
                    break;
                }
            }
            if (!wflag) { //???????????§????????????????????£??????
                primeList.add(i); //?´???°??¨????????°????????????
            }
        } { //????±?????\???°??????
            boolean wflag = false; //???????????????????????????
            for (int j = 1; primeList.get(j) * primeList.get(j) <= i; j++) {
                // ????±??????°??????????????\????????¨???????´???°??§????????????
                if (0 == i % primeList.get(j)) { //???????????????????´???°??§?????????
                    wflag = true;
                    break;
                }
            }
            if (!wflag) { //???????????§????????????????????£??????
                primeList.add(i); //?´???°??¨????????°????????????
            }
        } boolean wflag = false; wflag false for (int j = 1; primeList.get(j) * primeList.get(j) <= i; j++) {
                // ????±??????°??????????????\????????¨???????´???°??§????????????
                if (0 == i % primeList.get(j)) { //???????????????????´???°??§?????????
                    wflag = true;
                    break;
                }
            } int j = 1; int j = 1; j 1 primeList.get(j) * primeList.get(j) <= i primeList.get(j) * primeList.get(j) primeList.get(j) primeList.get primeList j primeList.get(j) primeList.get primeList j i j++ j++ j {
                // ????±??????°??????????????\????????¨???????´???°??§????????????
                if (0 == i % primeList.get(j)) { //???????????????????´???°??§?????????
                    wflag = true;
                    break;
                }
            } {
                // ????±??????°??????????????\????????¨???????´???°??§????????????
                if (0 == i % primeList.get(j)) { //???????????????????´???°??§?????????
                    wflag = true;
                    break;
                }
            } if (0 == i % primeList.get(j)) { //???????????????????´???°??§?????????
                    wflag = true;
                    break;
                } 0 == i % primeList.get(j) 0 i % primeList.get(j) i primeList.get(j) primeList.get primeList j { //???????????????????´???°??§?????????
                    wflag = true;
                    break;
                } wflag = true wflag true break; if (!wflag) { //???????????§????????????????????£??????
                primeList.add(i); //?´???°??¨????????°????????????
            } !wflag wflag { //???????????§????????????????????£??????
                primeList.add(i); //?´???°??¨????????°????????????
            } primeList.add(i) primeList.add primeList i ArrayList<Integer> primeList primeList public class Main {
    private static final int SIZE = 10000000;

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        ArrayList<Integer> primeList = new ArrayList<Integer>(SIZE);
        createPrime(primeList);
        int n = Integer.parseInt(br.readLine());
        int count = 0;
        for (int i = 0; i < n; i++) {
            int p = Integer.parseInt(br.readLine());
            if (prime(p, primeList)) {
                count++;
            }
        }
        System.out.println(count);
    }

    static boolean prime(int n, ArrayList<Integer> primeList) {
        if (n <= 1000000) {
            for (int i = 0; primeList.get(i) * primeList.get(i) <= n; i++) {
                // ????±??????°??????????????\????????¨???????´???°??§????????????
                if (0 == n % primeList.get(i)) { //???????????????????´???°??§?????????
                    return false;
                }
            }
            return true;
        } else {
            for (int i = 0; primeList.get(i) * primeList.get(i) <= 1000000; i++) {
                // ????±??????°??????????????\????????¨???????´???°??§????????????
                if (0 == n % primeList.get(i)) { //???????????????????´???°??§?????????
                    return false;
                }
            }
            for (int i = 3; i * i <= n; i += 2) {
                if (n % i == 0) {
                    return false;
                }
            }
            return true;
        }
    }

    public static void createPrime(ArrayList<Integer> primeList) {
        int n = 1000000;
        primeList.add(2);
        primeList.add(3);
        for (int i = 5; i <= n; i += 2) { //????±?????\???°??????
            boolean wflag = false; //???????????????????????????
            for (int j = 1; primeList.get(j) * primeList.get(j) <= i; j++) {
                // ????±??????°??????????????\????????¨???????´???°??§????????????
                if (0 == i % primeList.get(j)) { //???????????????????´???°??§?????????
                    wflag = true;
                    break;
                }
            }
            if (!wflag) { //???????????§????????????????????£??????
                primeList.add(i); //?´???°??¨????????°????????????
            }
        }
    }
} public class Main {
    private static final int SIZE = 10000000;

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        ArrayList<Integer> primeList = new ArrayList<Integer>(SIZE);
        createPrime(primeList);
        int n = Integer.parseInt(br.readLine());
        int count = 0;
        for (int i = 0; i < n; i++) {
            int p = Integer.parseInt(br.readLine());
            if (prime(p, primeList)) {
                count++;
            }
        }
        System.out.println(count);
    }

    static boolean prime(int n, ArrayList<Integer> primeList) {
        if (n <= 1000000) {
            for (int i = 0; primeList.get(i) * primeList.get(i) <= n; i++) {
                // ????±??????°??????????????\????????¨???????´???°??§????????????
                if (0 == n % primeList.get(i)) { //???????????????????´???°??§?????????
                    return false;
                }
            }
            return true;
        } else {
            for (int i = 0; primeList.get(i) * primeList.get(i) <= 1000000; i++) {
                // ????±??????°??????????????\????????¨???????´???°??§????????????
                if (0 == n % primeList.get(i)) { //???????????????????´???°??§?????????
                    return false;
                }
            }
            for (int i = 3; i * i <= n; i += 2) {
                if (n % i == 0) {
                    return false;
                }
            }
            return true;
        }
    }

    public static void createPrime(ArrayList<Integer> primeList) {
        int n = 1000000;
        primeList.add(2);
        primeList.add(3);
        for (int i = 5; i <= n; i += 2) { //????±?????\???°??????
            boolean wflag = false; //???????????????????????????
            for (int j = 1; primeList.get(j) * primeList.get(j) <= i; j++) {
                // ????±??????°??????????????\????????¨???????´???°??§????????????
                if (0 == i % primeList.get(j)) { //???????????????????´???°??§?????????
                    wflag = true;
                    break;
                }
            }
            if (!wflag) { //???????????§????????????????????£??????
                primeList.add(i); //?´???°??¨????????°????????????
            }
        }
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class Main {
    private static final int SIZE = 10000000;

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        ArrayList<Integer> primeList = new ArrayList<Integer>(SIZE);
        createPrime(primeList);
        int n = Integer.parseInt(br.readLine());
        int count = 0;
        for (int i = 0; i < n; i++) {
            int p = Integer.parseInt(br.readLine());
            if (prime(p, primeList)) {
                count++;
            }
        }
        System.out.println(count);
    }

    static boolean prime(int n, ArrayList<Integer> primeList) {
        if (n <= 1000000) {
            for (int i = 0; primeList.get(i) * primeList.get(i) <= n; i++) {
                // ????±??????°??????????????\????????¨???????´???°??§????????????
                if (0 == n % primeList.get(i)) { //???????????????????´???°??§?????????
                    return false;
                }
            }
            return true;
        } else {
            for (int i = 0; primeList.get(i) * primeList.get(i) <= 1000000; i++) {
                // ????±??????°??????????????\????????¨???????´???°??§????????????
                if (0 == n % primeList.get(i)) { //???????????????????´???°??§?????????
                    return false;
                }
            }
            for (int i = 3; i * i <= n; i += 2) {
                if (n % i == 0) {
                    return false;
                }
            }
            return true;
        }
    }

    public static void createPrime(ArrayList<Integer> primeList) {
        int n = 1000000;
        primeList.add(2);
        primeList.add(3);
        for (int i = 5; i <= n; i += 2) { //????±?????\???°??????
            boolean wflag = false; //???????????????????????????
            for (int j = 1; primeList.get(j) * primeList.get(j) <= i; j++) {
                // ????±??????°??????????????\????????¨???????´???°??§????????????
                if (0 == i % primeList.get(j)) { //???????????????????´???°??§?????????
                    wflag = true;
                    break;
                }
            }
            if (!wflag) { //???????????§????????????????????£??????
                primeList.add(i); //?´???°??¨????????°????????????
            }
        }
    }
}