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

public class Main {

    public static void main(String[] args) throws NumberFormatException, IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());

        int number = 0;
        int count = 0;

        for(int i = 0; i < n; i++){
            if(checkPrimeNumber(Integer.parseInt(br.readLine()))){
                count++;
            }
        }
        System.out.println(count);
    }

    private static boolean checkPrimeNumber(int number) {
        if(number < 2){
            return false;
        }
        if(number == 2){
            return true;
        }
        if(number % 2 == 0){
            return false;
        }
        for(int i = 3; i <= Math.sqrt(number); i += 2){
            if(number % i == 0){
                return false;
            }
        }
        return true;
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

    public static void main(String[] args) throws NumberFormatException, IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());

        int number = 0;
        int count = 0;

        for(int i = 0; i < n; i++){
            if(checkPrimeNumber(Integer.parseInt(br.readLine()))){
                count++;
            }
        }
        System.out.println(count);
    }

    private static boolean checkPrimeNumber(int number) {
        if(number < 2){
            return false;
        }
        if(number == 2){
            return true;
        }
        if(number % 2 == 0){
            return false;
        }
        for(int i = 3; i <= Math.sqrt(number); i += 2){
            if(number % i == 0){
                return false;
            }
        }
        return true;
    }
} Main public static void main(String[] args) throws NumberFormatException, IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());

        int number = 0;
        int count = 0;

        for(int i = 0; i < n; i++){
            if(checkPrimeNumber(Integer.parseInt(br.readLine()))){
                count++;
            }
        }
        System.out.println(count);
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());

        int number = 0;
        int count = 0;

        for(int i = 0; i < n; i++){
            if(checkPrimeNumber(Integer.parseInt(br.readLine()))){
                count++;
            }
        }
        System.out.println(count);
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int number = 0; number 0 int count = 0; count 0 for(int i = 0; i < n; i++){
            if(checkPrimeNumber(Integer.parseInt(br.readLine()))){
                count++;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            if(checkPrimeNumber(Integer.parseInt(br.readLine()))){
                count++;
            }
        } {
            if(checkPrimeNumber(Integer.parseInt(br.readLine()))){
                count++;
            }
        } if(checkPrimeNumber(Integer.parseInt(br.readLine()))){
                count++;
            } checkPrimeNumber(Integer.parseInt(br.readLine())) checkPrimeNumber Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br {
                count++;
            } count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args private static boolean checkPrimeNumber(int number) {
        if(number < 2){
            return false;
        }
        if(number == 2){
            return true;
        }
        if(number % 2 == 0){
            return false;
        }
        for(int i = 3; i <= Math.sqrt(number); i += 2){
            if(number % i == 0){
                return false;
            }
        }
        return true;
    } checkPrimeNumber {
        if(number < 2){
            return false;
        }
        if(number == 2){
            return true;
        }
        if(number % 2 == 0){
            return false;
        }
        for(int i = 3; i <= Math.sqrt(number); i += 2){
            if(number % i == 0){
                return false;
            }
        }
        return true;
    } if(number < 2){
            return false;
        } number < 2 number 2 {
            return false;
        } return false; false if(number == 2){
            return true;
        } number == 2 number 2 {
            return true;
        } return true; true if(number % 2 == 0){
            return false;
        } number % 2 == 0 number % 2 number 2 0 {
            return false;
        } return false; false for(int i = 3; i <= Math.sqrt(number); i += 2){
            if(number % i == 0){
                return false;
            }
        } int i = 3; int i = 3; i 3 i <= Math.sqrt(number) i Math.sqrt(number) Math.sqrt Math number i += 2 i += 2 i 2 {
            if(number % i == 0){
                return false;
            }
        } {
            if(number % i == 0){
                return false;
            }
        } if(number % i == 0){
                return false;
            } number % i == 0 number % i number i 0 {
                return false;
            } return false; false return true; true int number number public class Main {

    public static void main(String[] args) throws NumberFormatException, IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());

        int number = 0;
        int count = 0;

        for(int i = 0; i < n; i++){
            if(checkPrimeNumber(Integer.parseInt(br.readLine()))){
                count++;
            }
        }
        System.out.println(count);
    }

    private static boolean checkPrimeNumber(int number) {
        if(number < 2){
            return false;
        }
        if(number == 2){
            return true;
        }
        if(number % 2 == 0){
            return false;
        }
        for(int i = 3; i <= Math.sqrt(number); i += 2){
            if(number % i == 0){
                return false;
            }
        }
        return true;
    }
} public class Main {

    public static void main(String[] args) throws NumberFormatException, IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());

        int number = 0;
        int count = 0;

        for(int i = 0; i < n; i++){
            if(checkPrimeNumber(Integer.parseInt(br.readLine()))){
                count++;
            }
        }
        System.out.println(count);
    }

    private static boolean checkPrimeNumber(int number) {
        if(number < 2){
            return false;
        }
        if(number == 2){
            return true;
        }
        if(number % 2 == 0){
            return false;
        }
        for(int i = 3; i <= Math.sqrt(number); i += 2){
            if(number % i == 0){
                return false;
            }
        }
        return true;
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws NumberFormatException, IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());

        int number = 0;
        int count = 0;

        for(int i = 0; i < n; i++){
            if(checkPrimeNumber(Integer.parseInt(br.readLine()))){
                count++;
            }
        }
        System.out.println(count);
    }

    private static boolean checkPrimeNumber(int number) {
        if(number < 2){
            return false;
        }
        if(number == 2){
            return true;
        }
        if(number % 2 == 0){
            return false;
        }
        for(int i = 3; i <= Math.sqrt(number); i += 2){
            if(number % i == 0){
                return false;
            }
        }
        return true;
    }
}