import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.next());

        int count = 0;
        for (int i = 0; i < n; i++) {
            int p = Integer.parseInt(scanner.next());
            if (isPrime(p)) {
                count++;
            }
        }

        System.out.println(count);
    }

    private static boolean isPrime(int p) {
        if (p == 1) {
            return false;
        }

        if (p == 2) {
            return true;
        }

        if (p % 2 == 0) {
            return false;
        }

        for (int i = 3; i <= Math.ceil(Math.sqrt(p)); i += 2) {
            if (p % i == 0) {
                return false;
            }
        }

        return true;
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.next());

        int count = 0;
        for (int i = 0; i < n; i++) {
            int p = Integer.parseInt(scanner.next());
            if (isPrime(p)) {
                count++;
            }
        }

        System.out.println(count);
    }

    private static boolean isPrime(int p) {
        if (p == 1) {
            return false;
        }

        if (p == 2) {
            return true;
        }

        if (p % 2 == 0) {
            return false;
        }

        for (int i = 3; i <= Math.ceil(Math.sqrt(p)); i += 2) {
            if (p % i == 0) {
                return false;
            }
        }

        return true;
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.next());

        int count = 0;
        for (int i = 0; i < n; i++) {
            int p = Integer.parseInt(scanner.next());
            if (isPrime(p)) {
                count++;
            }
        }

        System.out.println(count);
    } main {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.next());

        int count = 0;
        for (int i = 0; i < n; i++) {
            int p = Integer.parseInt(scanner.next());
            if (isPrime(p)) {
                count++;
            }
        }

        System.out.println(count);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = Integer.parseInt(scanner.next()); n Integer.parseInt(scanner.next()) Integer.parseInt Integer scanner.next() scanner.next scanner int count = 0; count 0 for (int i = 0; i < n; i++) {
            int p = Integer.parseInt(scanner.next());
            if (isPrime(p)) {
                count++;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            int p = Integer.parseInt(scanner.next());
            if (isPrime(p)) {
                count++;
            }
        } {
            int p = Integer.parseInt(scanner.next());
            if (isPrime(p)) {
                count++;
            }
        } int p = Integer.parseInt(scanner.next()); p Integer.parseInt(scanner.next()) Integer.parseInt Integer scanner.next() scanner.next scanner if (isPrime(p)) {
                count++;
            } isPrime(p) isPrime p {
                count++;
            } count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args private static boolean isPrime(int p) {
        if (p == 1) {
            return false;
        }

        if (p == 2) {
            return true;
        }

        if (p % 2 == 0) {
            return false;
        }

        for (int i = 3; i <= Math.ceil(Math.sqrt(p)); i += 2) {
            if (p % i == 0) {
                return false;
            }
        }

        return true;
    } isPrime {
        if (p == 1) {
            return false;
        }

        if (p == 2) {
            return true;
        }

        if (p % 2 == 0) {
            return false;
        }

        for (int i = 3; i <= Math.ceil(Math.sqrt(p)); i += 2) {
            if (p % i == 0) {
                return false;
            }
        }

        return true;
    } if (p == 1) {
            return false;
        } p == 1 p 1 {
            return false;
        } return false; false if (p == 2) {
            return true;
        } p == 2 p 2 {
            return true;
        } return true; true if (p % 2 == 0) {
            return false;
        } p % 2 == 0 p % 2 p 2 0 {
            return false;
        } return false; false for (int i = 3; i <= Math.ceil(Math.sqrt(p)); i += 2) {
            if (p % i == 0) {
                return false;
            }
        } int i = 3; int i = 3; i 3 i <= Math.ceil(Math.sqrt(p)) i Math.ceil(Math.sqrt(p)) Math.ceil Math Math.sqrt(p) Math.sqrt Math p i += 2 i += 2 i 2 {
            if (p % i == 0) {
                return false;
            }
        } {
            if (p % i == 0) {
                return false;
            }
        } if (p % i == 0) {
                return false;
            } p % i == 0 p % i p i 0 {
                return false;
            } return false; false return true; true int p p public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.next());

        int count = 0;
        for (int i = 0; i < n; i++) {
            int p = Integer.parseInt(scanner.next());
            if (isPrime(p)) {
                count++;
            }
        }

        System.out.println(count);
    }

    private static boolean isPrime(int p) {
        if (p == 1) {
            return false;
        }

        if (p == 2) {
            return true;
        }

        if (p % 2 == 0) {
            return false;
        }

        for (int i = 3; i <= Math.ceil(Math.sqrt(p)); i += 2) {
            if (p % i == 0) {
                return false;
            }
        }

        return true;
    }
} public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.next());

        int count = 0;
        for (int i = 0; i < n; i++) {
            int p = Integer.parseInt(scanner.next());
            if (isPrime(p)) {
                count++;
            }
        }

        System.out.println(count);
    }

    private static boolean isPrime(int p) {
        if (p == 1) {
            return false;
        }

        if (p == 2) {
            return true;
        }

        if (p % 2 == 0) {
            return false;
        }

        for (int i = 3; i <= Math.ceil(Math.sqrt(p)); i += 2) {
            if (p % i == 0) {
                return false;
            }
        }

        return true;
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.next());

        int count = 0;
        for (int i = 0; i < n; i++) {
            int p = Integer.parseInt(scanner.next());
            if (isPrime(p)) {
                count++;
            }
        }

        System.out.println(count);
    }

    private static boolean isPrime(int p) {
        if (p == 1) {
            return false;
        }

        if (p == 2) {
            return true;
        }

        if (p % 2 == 0) {
            return false;
        }

        for (int i = 3; i <= Math.ceil(Math.sqrt(p)); i += 2) {
            if (p % i == 0) {
                return false;
            }
        }

        return true;
    }
}