import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            boolean[] FURUI = new boolean[100_000_000 + 1];
            for (int i = 2; i < FURUI.length; i++) {
                FURUI[i] = true;
            }
            for (int i = 2; i * i <= FURUI.length; i++) {
                if (FURUI[i] == false) {
                    continue;
                }
                for (int j = i + i; j < FURUI.length; j += i) {
                    FURUI[j] = false;
                }
            }
            int count = 0;
            while (N-- > 0) {
                count += FURUI[in.nextInt()] ? 1 : 0;
            }
            System.out.println(count);
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            boolean[] FURUI = new boolean[100_000_000 + 1];
            for (int i = 2; i < FURUI.length; i++) {
                FURUI[i] = true;
            }
            for (int i = 2; i * i <= FURUI.length; i++) {
                if (FURUI[i] == false) {
                    continue;
                }
                for (int j = i + i; j < FURUI.length; j += i) {
                    FURUI[j] = false;
                }
            }
            int count = 0;
            while (N-- > 0) {
                count += FURUI[in.nextInt()] ? 1 : 0;
            }
            System.out.println(count);
        }
    }
} Main public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            boolean[] FURUI = new boolean[100_000_000 + 1];
            for (int i = 2; i < FURUI.length; i++) {
                FURUI[i] = true;
            }
            for (int i = 2; i * i <= FURUI.length; i++) {
                if (FURUI[i] == false) {
                    continue;
                }
                for (int j = i + i; j < FURUI.length; j += i) {
                    FURUI[j] = false;
                }
            }
            int count = 0;
            while (N-- > 0) {
                count += FURUI[in.nextInt()] ? 1 : 0;
            }
            System.out.println(count);
        }
    } main {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            boolean[] FURUI = new boolean[100_000_000 + 1];
            for (int i = 2; i < FURUI.length; i++) {
                FURUI[i] = true;
            }
            for (int i = 2; i * i <= FURUI.length; i++) {
                if (FURUI[i] == false) {
                    continue;
                }
                for (int j = i + i; j < FURUI.length; j += i) {
                    FURUI[j] = false;
                }
            }
            int count = 0;
            while (N-- > 0) {
                count += FURUI[in.nextInt()] ? 1 : 0;
            }
            System.out.println(count);
        }
    } try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            boolean[] FURUI = new boolean[100_000_000 + 1];
            for (int i = 2; i < FURUI.length; i++) {
                FURUI[i] = true;
            }
            for (int i = 2; i * i <= FURUI.length; i++) {
                if (FURUI[i] == false) {
                    continue;
                }
                for (int j = i + i; j < FURUI.length; j += i) {
                    FURUI[j] = false;
                }
            }
            int count = 0;
            while (N-- > 0) {
                count += FURUI[in.nextInt()] ? 1 : 0;
            }
            System.out.println(count);
        } {
            int N = in.nextInt();
            boolean[] FURUI = new boolean[100_000_000 + 1];
            for (int i = 2; i < FURUI.length; i++) {
                FURUI[i] = true;
            }
            for (int i = 2; i * i <= FURUI.length; i++) {
                if (FURUI[i] == false) {
                    continue;
                }
                for (int j = i + i; j < FURUI.length; j += i) {
                    FURUI[j] = false;
                }
            }
            int count = 0;
            while (N-- > 0) {
                count += FURUI[in.nextInt()] ? 1 : 0;
            }
            System.out.println(count);
        } Scanner in = new Scanner(System.in) Scanner in = new Scanner(System.in) new Scanner(System.in) int N = in.nextInt(); N in.nextInt() in.nextInt in boolean[] FURUI = new boolean[100_000_000 + 1]; FURUI new boolean[100_000_000 + 1] 100_000_000 + 1 100_000_000 1 for (int i = 2; i < FURUI.length; i++) {
                FURUI[i] = true;
            } int i = 2; int i = 2; i 2 i < FURUI.length i FURUI.length FURUI FURUI.length i++ i++ i {
                FURUI[i] = true;
            } {
                FURUI[i] = true;
            } FURUI[i] = true FURUI[i] FURUI i true for (int i = 2; i * i <= FURUI.length; i++) {
                if (FURUI[i] == false) {
                    continue;
                }
                for (int j = i + i; j < FURUI.length; j += i) {
                    FURUI[j] = false;
                }
            } int i = 2; int i = 2; i 2 i * i <= FURUI.length i * i i i FURUI.length FURUI FURUI.length i++ i++ i {
                if (FURUI[i] == false) {
                    continue;
                }
                for (int j = i + i; j < FURUI.length; j += i) {
                    FURUI[j] = false;
                }
            } {
                if (FURUI[i] == false) {
                    continue;
                }
                for (int j = i + i; j < FURUI.length; j += i) {
                    FURUI[j] = false;
                }
            } if (FURUI[i] == false) {
                    continue;
                } FURUI[i] == false FURUI[i] FURUI i false {
                    continue;
                } continue; for (int j = i + i; j < FURUI.length; j += i) {
                    FURUI[j] = false;
                } int j = i + i; int j = i + i; j i + i i i j < FURUI.length j FURUI.length FURUI FURUI.length j += i j += i j i {
                    FURUI[j] = false;
                } {
                    FURUI[j] = false;
                } FURUI[j] = false FURUI[j] FURUI j false int count = 0; count 0 while (N-- > 0) {
                count += FURUI[in.nextInt()] ? 1 : 0;
            } N-- > 0 N-- N 0 {
                count += FURUI[in.nextInt()] ? 1 : 0;
            } count += FURUI[in.nextInt()] ? 1 : 0 count FURUI[in.nextInt()] ? 1 : 0 FURUI[in.nextInt()] FURUI in.nextInt() in.nextInt in 1 0 System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            boolean[] FURUI = new boolean[100_000_000 + 1];
            for (int i = 2; i < FURUI.length; i++) {
                FURUI[i] = true;
            }
            for (int i = 2; i * i <= FURUI.length; i++) {
                if (FURUI[i] == false) {
                    continue;
                }
                for (int j = i + i; j < FURUI.length; j += i) {
                    FURUI[j] = false;
                }
            }
            int count = 0;
            while (N-- > 0) {
                count += FURUI[in.nextInt()] ? 1 : 0;
            }
            System.out.println(count);
        }
    }
} public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            boolean[] FURUI = new boolean[100_000_000 + 1];
            for (int i = 2; i < FURUI.length; i++) {
                FURUI[i] = true;
            }
            for (int i = 2; i * i <= FURUI.length; i++) {
                if (FURUI[i] == false) {
                    continue;
                }
                for (int j = i + i; j < FURUI.length; j += i) {
                    FURUI[j] = false;
                }
            }
            int count = 0;
            while (N-- > 0) {
                count += FURUI[in.nextInt()] ? 1 : 0;
            }
            System.out.println(count);
        }
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            boolean[] FURUI = new boolean[100_000_000 + 1];
            for (int i = 2; i < FURUI.length; i++) {
                FURUI[i] = true;
            }
            for (int i = 2; i * i <= FURUI.length; i++) {
                if (FURUI[i] == false) {
                    continue;
                }
                for (int j = i + i; j < FURUI.length; j += i) {
                    FURUI[j] = false;
                }
            }
            int count = 0;
            while (N-- > 0) {
                count += FURUI[in.nextInt()] ? 1 : 0;
            }
            System.out.println(count);
        }
    }
}