import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int count = sc.nextInt();
        int sum = 0;
        for (int i = 0; i < count; i++) {
            sum += isPrimeNumber(sc.nextLong()) ? 1 : 0;
        }
        System.out.println(sum);
    }

    private static boolean isPrimeNumber(long a) {
        if (a == 2) {
            return true;
        } else if (a < 2 || a % 2 == 0) {
            return false;
        }

        long sqrt = (long) Math.sqrt(a);
        for (int i = 3; i <= sqrt; i += 2) {
            if (a % i == 0) {
                return false;
            }
        }
        return true;
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int count = sc.nextInt();
        int sum = 0;
        for (int i = 0; i < count; i++) {
            sum += isPrimeNumber(sc.nextLong()) ? 1 : 0;
        }
        System.out.println(sum);
    }

    private static boolean isPrimeNumber(long a) {
        if (a == 2) {
            return true;
        } else if (a < 2 || a % 2 == 0) {
            return false;
        }

        long sqrt = (long) Math.sqrt(a);
        for (int i = 3; i <= sqrt; i += 2) {
            if (a % i == 0) {
                return false;
            }
        }
        return true;
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int count = sc.nextInt();
        int sum = 0;
        for (int i = 0; i < count; i++) {
            sum += isPrimeNumber(sc.nextLong()) ? 1 : 0;
        }
        System.out.println(sum);
    } main {
        Scanner sc = new Scanner(System.in);
        int count = sc.nextInt();
        int sum = 0;
        for (int i = 0; i < count; i++) {
            sum += isPrimeNumber(sc.nextLong()) ? 1 : 0;
        }
        System.out.println(sum);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int count = sc.nextInt(); count sc.nextInt() sc.nextInt sc int sum = 0; sum 0 for (int i = 0; i < count; i++) {
            sum += isPrimeNumber(sc.nextLong()) ? 1 : 0;
        } int i = 0; int i = 0; i 0 i < count i count i++ i++ i {
            sum += isPrimeNumber(sc.nextLong()) ? 1 : 0;
        } {
            sum += isPrimeNumber(sc.nextLong()) ? 1 : 0;
        } sum += isPrimeNumber(sc.nextLong()) ? 1 : 0 sum isPrimeNumber(sc.nextLong()) ? 1 : 0 isPrimeNumber(sc.nextLong()) isPrimeNumber sc.nextLong() sc.nextLong sc 1 0 System.out.println(sum) System.out.println System.out System System.out sum String[] args args private static boolean isPrimeNumber(long a) {
        if (a == 2) {
            return true;
        } else if (a < 2 || a % 2 == 0) {
            return false;
        }

        long sqrt = (long) Math.sqrt(a);
        for (int i = 3; i <= sqrt; i += 2) {
            if (a % i == 0) {
                return false;
            }
        }
        return true;
    } isPrimeNumber {
        if (a == 2) {
            return true;
        } else if (a < 2 || a % 2 == 0) {
            return false;
        }

        long sqrt = (long) Math.sqrt(a);
        for (int i = 3; i <= sqrt; i += 2) {
            if (a % i == 0) {
                return false;
            }
        }
        return true;
    } if (a == 2) {
            return true;
        } else if (a < 2 || a % 2 == 0) {
            return false;
        } a == 2 a 2 {
            return true;
        } return true; true if (a < 2 || a % 2 == 0) {
            return false;
        } a < 2 || a % 2 == 0 a < 2 a 2 a % 2 == 0 a % 2 a 2 0 {
            return false;
        } return false; false long sqrt = (long) Math.sqrt(a); sqrt (long) Math.sqrt(a) Math.sqrt Math a for (int i = 3; i <= sqrt; i += 2) {
            if (a % i == 0) {
                return false;
            }
        } int i = 3; int i = 3; i 3 i <= sqrt i sqrt i += 2 i += 2 i 2 {
            if (a % i == 0) {
                return false;
            }
        } {
            if (a % i == 0) {
                return false;
            }
        } if (a % i == 0) {
                return false;
            } a % i == 0 a % i a i 0 {
                return false;
            } return false; false return true; true long a a public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int count = sc.nextInt();
        int sum = 0;
        for (int i = 0; i < count; i++) {
            sum += isPrimeNumber(sc.nextLong()) ? 1 : 0;
        }
        System.out.println(sum);
    }

    private static boolean isPrimeNumber(long a) {
        if (a == 2) {
            return true;
        } else if (a < 2 || a % 2 == 0) {
            return false;
        }

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

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int count = sc.nextInt();
        int sum = 0;
        for (int i = 0; i < count; i++) {
            sum += isPrimeNumber(sc.nextLong()) ? 1 : 0;
        }
        System.out.println(sum);
    }

    private static boolean isPrimeNumber(long a) {
        if (a == 2) {
            return true;
        } else if (a < 2 || a % 2 == 0) {
            return false;
        }

        long sqrt = (long) Math.sqrt(a);
        for (int i = 3; i <= sqrt; i += 2) {
            if (a % i == 0) {
                return false;
            }
        }
        return true;
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int count = sc.nextInt();
        int sum = 0;
        for (int i = 0; i < count; i++) {
            sum += isPrimeNumber(sc.nextLong()) ? 1 : 0;
        }
        System.out.println(sum);
    }

    private static boolean isPrimeNumber(long a) {
        if (a == 2) {
            return true;
        } else if (a < 2 || a % 2 == 0) {
            return false;
        }

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