import java.util.Scanner;

/**
 * Prime
 */
public class Main {

    public int size;
    public int[] mx;

    public void scan() {
        Scanner sc = new Scanner(System.in);
        this.size = sc.nextInt();
        this.mx = new int[this.size];
        for (int i = 0; i < this.size; i++) {
            this.mx[i] = sc.nextInt();
        }
    }

    public void taskA() {
        // long start = System.currentTimeMillis();
        int count = 0;
        for (int i = 0; i < this.size; i++) {
            boolean flg = false;
            int sqrt = (int) (Math.sqrt(this.mx[i]));
            for (int j = 2; j <= sqrt; j++) {
                if (mx[i] % j == 0) {
                    flg = true;
                    break;
                }
            }
            if (!flg) {
                count++;
            }
        }
        // long end = System.currentTimeMillis();
        System.out.println(count);
        // System.out.println((end - start) + "ms");
    }

    public void taskB() {
        long start = System.currentTimeMillis();
        boolean[] eratosthenes = new boolean[100000000];
        eratosthenes[0] = true;
        for (int i = 2; i <= 100000000; i++) {
            int j = i;
            while (j <= 100000000) {
                if (!eratosthenes[j - 1]) {
                    eratosthenes[j - 1] = true;
                }
                j += i;
            }
            System.out.println("end: " + i);
        }
        int count = 0;
        for (int i = 1; i < this.size; i++) {
            if (!eratosthenes[i]) {
                count++;
            }
        }
        long end = System.currentTimeMillis();
        System.out.println(count);
        System.out.println((end - start) + "ms");
    }

    public static void main(String[] args) {
        Main prime = new Main();
        prime.scan();
        prime.taskA();
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public int size;
    public int[] mx;

    public void scan() {
        Scanner sc = new Scanner(System.in);
        this.size = sc.nextInt();
        this.mx = new int[this.size];
        for (int i = 0; i < this.size; i++) {
            this.mx[i] = sc.nextInt();
        }
    }

    public void taskA() {
        // long start = System.currentTimeMillis();
        int count = 0;
        for (int i = 0; i < this.size; i++) {
            boolean flg = false;
            int sqrt = (int) (Math.sqrt(this.mx[i]));
            for (int j = 2; j <= sqrt; j++) {
                if (mx[i] % j == 0) {
                    flg = true;
                    break;
                }
            }
            if (!flg) {
                count++;
            }
        }
        // long end = System.currentTimeMillis();
        System.out.println(count);
        // System.out.println((end - start) + "ms");
    }

    public void taskB() {
        long start = System.currentTimeMillis();
        boolean[] eratosthenes = new boolean[100000000];
        eratosthenes[0] = true;
        for (int i = 2; i <= 100000000; i++) {
            int j = i;
            while (j <= 100000000) {
                if (!eratosthenes[j - 1]) {
                    eratosthenes[j - 1] = true;
                }
                j += i;
            }
            System.out.println("end: " + i);
        }
        int count = 0;
        for (int i = 1; i < this.size; i++) {
            if (!eratosthenes[i]) {
                count++;
            }
        }
        long end = System.currentTimeMillis();
        System.out.println(count);
        System.out.println((end - start) + "ms");
    }

    public static void main(String[] args) {
        Main prime = new Main();
        prime.scan();
        prime.taskA();
    }
} Main public int size; size public int[] mx; mx public void scan() {
        Scanner sc = new Scanner(System.in);
        this.size = sc.nextInt();
        this.mx = new int[this.size];
        for (int i = 0; i < this.size; i++) {
            this.mx[i] = sc.nextInt();
        }
    } scan {
        Scanner sc = new Scanner(System.in);
        this.size = sc.nextInt();
        this.mx = new int[this.size];
        for (int i = 0; i < this.size; i++) {
            this.mx[i] = sc.nextInt();
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) this.size = sc.nextInt() this.size this this.size sc.nextInt() sc.nextInt sc this.mx = new int[this.size] this.mx this this.mx new int[this.size] this.size this this.size for (int i = 0; i < this.size; i++) {
            this.mx[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < this.size i this.size this this.size i++ i++ i {
            this.mx[i] = sc.nextInt();
        } {
            this.mx[i] = sc.nextInt();
        } this.mx[i] = sc.nextInt() this.mx[i] this.mx this this.mx i sc.nextInt() sc.nextInt sc public void taskA() {
        // long start = System.currentTimeMillis();
        int count = 0;
        for (int i = 0; i < this.size; i++) {
            boolean flg = false;
            int sqrt = (int) (Math.sqrt(this.mx[i]));
            for (int j = 2; j <= sqrt; j++) {
                if (mx[i] % j == 0) {
                    flg = true;
                    break;
                }
            }
            if (!flg) {
                count++;
            }
        }
        // long end = System.currentTimeMillis();
        System.out.println(count);
        // System.out.println((end - start) + "ms");
    } taskA {
        // long start = System.currentTimeMillis();
        int count = 0;
        for (int i = 0; i < this.size; i++) {
            boolean flg = false;
            int sqrt = (int) (Math.sqrt(this.mx[i]));
            for (int j = 2; j <= sqrt; j++) {
                if (mx[i] % j == 0) {
                    flg = true;
                    break;
                }
            }
            if (!flg) {
                count++;
            }
        }
        // long end = System.currentTimeMillis();
        System.out.println(count);
        // System.out.println((end - start) + "ms");
    } int count = 0; count 0 for (int i = 0; i < this.size; i++) {
            boolean flg = false;
            int sqrt = (int) (Math.sqrt(this.mx[i]));
            for (int j = 2; j <= sqrt; j++) {
                if (mx[i] % j == 0) {
                    flg = true;
                    break;
                }
            }
            if (!flg) {
                count++;
            }
        } int i = 0; int i = 0; i 0 i < this.size i this.size this this.size i++ i++ i {
            boolean flg = false;
            int sqrt = (int) (Math.sqrt(this.mx[i]));
            for (int j = 2; j <= sqrt; j++) {
                if (mx[i] % j == 0) {
                    flg = true;
                    break;
                }
            }
            if (!flg) {
                count++;
            }
        } {
            boolean flg = false;
            int sqrt = (int) (Math.sqrt(this.mx[i]));
            for (int j = 2; j <= sqrt; j++) {
                if (mx[i] % j == 0) {
                    flg = true;
                    break;
                }
            }
            if (!flg) {
                count++;
            }
        } boolean flg = false; flg false int sqrt = (int) (Math.sqrt(this.mx[i])); sqrt (int) (Math.sqrt(this.mx[i])) Math.sqrt Math this.mx[i] this.mx this this.mx i for (int j = 2; j <= sqrt; j++) {
                if (mx[i] % j == 0) {
                    flg = true;
                    break;
                }
            } int j = 2; int j = 2; j 2 j <= sqrt j sqrt j++ j++ j {
                if (mx[i] % j == 0) {
                    flg = true;
                    break;
                }
            } {
                if (mx[i] % j == 0) {
                    flg = true;
                    break;
                }
            } if (mx[i] % j == 0) {
                    flg = true;
                    break;
                } mx[i] % j == 0 mx[i] % j mx[i] mx i j 0 {
                    flg = true;
                    break;
                } flg = true flg true break; if (!flg) {
                count++;
            } !flg flg {
                count++;
            } count++ count System.out.println(count) System.out.println System.out System System.out count public void taskB() {
        long start = System.currentTimeMillis();
        boolean[] eratosthenes = new boolean[100000000];
        eratosthenes[0] = true;
        for (int i = 2; i <= 100000000; i++) {
            int j = i;
            while (j <= 100000000) {
                if (!eratosthenes[j - 1]) {
                    eratosthenes[j - 1] = true;
                }
                j += i;
            }
            System.out.println("end: " + i);
        }
        int count = 0;
        for (int i = 1; i < this.size; i++) {
            if (!eratosthenes[i]) {
                count++;
            }
        }
        long end = System.currentTimeMillis();
        System.out.println(count);
        System.out.println((end - start) + "ms");
    } taskB {
        long start = System.currentTimeMillis();
        boolean[] eratosthenes = new boolean[100000000];
        eratosthenes[0] = true;
        for (int i = 2; i <= 100000000; i++) {
            int j = i;
            while (j <= 100000000) {
                if (!eratosthenes[j - 1]) {
                    eratosthenes[j - 1] = true;
                }
                j += i;
            }
            System.out.println("end: " + i);
        }
        int count = 0;
        for (int i = 1; i < this.size; i++) {
            if (!eratosthenes[i]) {
                count++;
            }
        }
        long end = System.currentTimeMillis();
        System.out.println(count);
        System.out.println((end - start) + "ms");
    } long start = System.currentTimeMillis(); start System.currentTimeMillis() System.currentTimeMillis System boolean[] eratosthenes = new boolean[100000000]; eratosthenes new boolean[100000000] 100000000 eratosthenes[0] = true eratosthenes[0] eratosthenes 0 true for (int i = 2; i <= 100000000; i++) {
            int j = i;
            while (j <= 100000000) {
                if (!eratosthenes[j - 1]) {
                    eratosthenes[j - 1] = true;
                }
                j += i;
            }
            System.out.println("end: " + i);
        } int i = 2; int i = 2; i 2 i <= 100000000 i 100000000 i++ i++ i {
            int j = i;
            while (j <= 100000000) {
                if (!eratosthenes[j - 1]) {
                    eratosthenes[j - 1] = true;
                }
                j += i;
            }
            System.out.println("end: " + i);
        } {
            int j = i;
            while (j <= 100000000) {
                if (!eratosthenes[j - 1]) {
                    eratosthenes[j - 1] = true;
                }
                j += i;
            }
            System.out.println("end: " + i);
        } int j = i; j i while (j <= 100000000) {
                if (!eratosthenes[j - 1]) {
                    eratosthenes[j - 1] = true;
                }
                j += i;
            } j <= 100000000 j 100000000 {
                if (!eratosthenes[j - 1]) {
                    eratosthenes[j - 1] = true;
                }
                j += i;
            } if (!eratosthenes[j - 1]) {
                    eratosthenes[j - 1] = true;
                } !eratosthenes[j - 1] eratosthenes[j - 1] eratosthenes j - 1 j 1 {
                    eratosthenes[j - 1] = true;
                } eratosthenes[j - 1] = true eratosthenes[j - 1] eratosthenes j - 1 j 1 true j += i j i System.out.println("end: " + i) System.out.println System.out System System.out "end: " + i "end: " i int count = 0; count 0 for (int i = 1; i < this.size; i++) {
            if (!eratosthenes[i]) {
                count++;
            }
        } int i = 1; int i = 1; i 1 i < this.size i this.size this this.size i++ i++ i {
            if (!eratosthenes[i]) {
                count++;
            }
        } {
            if (!eratosthenes[i]) {
                count++;
            }
        } if (!eratosthenes[i]) {
                count++;
            } !eratosthenes[i] eratosthenes[i] eratosthenes i {
                count++;
            } count++ count long end = System.currentTimeMillis(); end System.currentTimeMillis() System.currentTimeMillis System System.out.println(count) System.out.println System.out System System.out count System.out.println((end - start) + "ms") System.out.println System.out System System.out (end - start) + "ms" (end - start) end start "ms" public static void main(String[] args) {
        Main prime = new Main();
        prime.scan();
        prime.taskA();
    } main {
        Main prime = new Main();
        prime.scan();
        prime.taskA();
    } Main prime = new Main(); prime new Main() prime.scan() prime.scan prime prime.taskA() prime.taskA prime String[] args args public class Main {

    public int size;
    public int[] mx;

    public void scan() {
        Scanner sc = new Scanner(System.in);
        this.size = sc.nextInt();
        this.mx = new int[this.size];
        for (int i = 0; i < this.size; i++) {
            this.mx[i] = sc.nextInt();
        }
    }

    public void taskA() {
        // long start = System.currentTimeMillis();
        int count = 0;
        for (int i = 0; i < this.size; i++) {
            boolean flg = false;
            int sqrt = (int) (Math.sqrt(this.mx[i]));
            for (int j = 2; j <= sqrt; j++) {
                if (mx[i] % j == 0) {
                    flg = true;
                    break;
                }
            }
            if (!flg) {
                count++;
            }
        }
        // long end = System.currentTimeMillis();
        System.out.println(count);
        // System.out.println((end - start) + "ms");
    }

    public void taskB() {
        long start = System.currentTimeMillis();
        boolean[] eratosthenes = new boolean[100000000];
        eratosthenes[0] = true;
        for (int i = 2; i <= 100000000; i++) {
            int j = i;
            while (j <= 100000000) {
                if (!eratosthenes[j - 1]) {
                    eratosthenes[j - 1] = true;
                }
                j += i;
            }
            System.out.println("end: " + i);
        }
        int count = 0;
        for (int i = 1; i < this.size; i++) {
            if (!eratosthenes[i]) {
                count++;
            }
        }
        long end = System.currentTimeMillis();
        System.out.println(count);
        System.out.println((end - start) + "ms");
    }

    public static void main(String[] args) {
        Main prime = new Main();
        prime.scan();
        prime.taskA();
    }
} public class Main {

    public int size;
    public int[] mx;

    public void scan() {
        Scanner sc = new Scanner(System.in);
        this.size = sc.nextInt();
        this.mx = new int[this.size];
        for (int i = 0; i < this.size; i++) {
            this.mx[i] = sc.nextInt();
        }
    }

    public void taskA() {
        // long start = System.currentTimeMillis();
        int count = 0;
        for (int i = 0; i < this.size; i++) {
            boolean flg = false;
            int sqrt = (int) (Math.sqrt(this.mx[i]));
            for (int j = 2; j <= sqrt; j++) {
                if (mx[i] % j == 0) {
                    flg = true;
                    break;
                }
            }
            if (!flg) {
                count++;
            }
        }
        // long end = System.currentTimeMillis();
        System.out.println(count);
        // System.out.println((end - start) + "ms");
    }

    public void taskB() {
        long start = System.currentTimeMillis();
        boolean[] eratosthenes = new boolean[100000000];
        eratosthenes[0] = true;
        for (int i = 2; i <= 100000000; i++) {
            int j = i;
            while (j <= 100000000) {
                if (!eratosthenes[j - 1]) {
                    eratosthenes[j - 1] = true;
                }
                j += i;
            }
            System.out.println("end: " + i);
        }
        int count = 0;
        for (int i = 1; i < this.size; i++) {
            if (!eratosthenes[i]) {
                count++;
            }
        }
        long end = System.currentTimeMillis();
        System.out.println(count);
        System.out.println((end - start) + "ms");
    }

    public static void main(String[] args) {
        Main prime = new Main();
        prime.scan();
        prime.taskA();
    }
} Main
import java.util.Scanner;

/**
 * Prime
 */
public class Main {

    public int size;
    public int[] mx;

    public void scan() {
        Scanner sc = new Scanner(System.in);
        this.size = sc.nextInt();
        this.mx = new int[this.size];
        for (int i = 0; i < this.size; i++) {
            this.mx[i] = sc.nextInt();
        }
    }

    public void taskA() {
        // long start = System.currentTimeMillis();
        int count = 0;
        for (int i = 0; i < this.size; i++) {
            boolean flg = false;
            int sqrt = (int) (Math.sqrt(this.mx[i]));
            for (int j = 2; j <= sqrt; j++) {
                if (mx[i] % j == 0) {
                    flg = true;
                    break;
                }
            }
            if (!flg) {
                count++;
            }
        }
        // long end = System.currentTimeMillis();
        System.out.println(count);
        // System.out.println((end - start) + "ms");
    }

    public void taskB() {
        long start = System.currentTimeMillis();
        boolean[] eratosthenes = new boolean[100000000];
        eratosthenes[0] = true;
        for (int i = 2; i <= 100000000; i++) {
            int j = i;
            while (j <= 100000000) {
                if (!eratosthenes[j - 1]) {
                    eratosthenes[j - 1] = true;
                }
                j += i;
            }
            System.out.println("end: " + i);
        }
        int count = 0;
        for (int i = 1; i < this.size; i++) {
            if (!eratosthenes[i]) {
                count++;
            }
        }
        long end = System.currentTimeMillis();
        System.out.println(count);
        System.out.println((end - start) + "ms");
    }

    public static void main(String[] args) {
        Main prime = new Main();
        prime.scan();
        prime.taskA();
    }
}
