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

class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int cnt = 0;
        for(int i=0;i<n;i++){
            if(isPrime(Integer.parseInt(br.readLine())))cnt++;
        }
        System.out.println(cnt);
    }
    public static boolean isPrime(int x){
        if(x == 2)return true; // 2
        else if(x % 2 == 0)return false;
        else if(x <= 7)return true; // 3,5,7
        else if(x % 3 == 0)return false;

        for(int i=5; i*i<=x; i+=6){
            if(x % i == 0)return false;
            if(x % (i + 2) == 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 class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int cnt = 0;
        for(int i=0;i<n;i++){
            if(isPrime(Integer.parseInt(br.readLine())))cnt++;
        }
        System.out.println(cnt);
    }
    public static boolean isPrime(int x){
        if(x == 2)return true; // 2
        else if(x % 2 == 0)return false;
        else if(x <= 7)return true; // 3,5,7
        else if(x % 3 == 0)return false;

        for(int i=5; i*i<=x; i+=6){
            if(x % i == 0)return false;
            if(x % (i + 2) == 0)return false;
        }
        return true;
    }
} Main public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int cnt = 0;
        for(int i=0;i<n;i++){
            if(isPrime(Integer.parseInt(br.readLine())))cnt++;
        }
        System.out.println(cnt);
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int cnt = 0;
        for(int i=0;i<n;i++){
            if(isPrime(Integer.parseInt(br.readLine())))cnt++;
        }
        System.out.println(cnt);
    } 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 cnt = 0; cnt 0 for(int i=0;i<n;i++){
            if(isPrime(Integer.parseInt(br.readLine())))cnt++;
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            if(isPrime(Integer.parseInt(br.readLine())))cnt++;
        } {
            if(isPrime(Integer.parseInt(br.readLine())))cnt++;
        } if(isPrime(Integer.parseInt(br.readLine())))cnt++; isPrime(Integer.parseInt(br.readLine())) isPrime Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br cnt++ cnt System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args public static boolean isPrime(int x){
        if(x == 2)return true; // 2
        else if(x % 2 == 0)return false;
        else if(x <= 7)return true; // 3,5,7
        else if(x % 3 == 0)return false;

        for(int i=5; i*i<=x; i+=6){
            if(x % i == 0)return false;
            if(x % (i + 2) == 0)return false;
        }
        return true;
    } isPrime {
        if(x == 2)return true; // 2
        else if(x % 2 == 0)return false;
        else if(x <= 7)return true; // 3,5,7
        else if(x % 3 == 0)return false;

        for(int i=5; i*i<=x; i+=6){
            if(x % i == 0)return false;
            if(x % (i + 2) == 0)return false;
        }
        return true;
    } if(x == 2)return true; // 2
        else if(x % 2 == 0)return false;
        else if(x <= 7)return true; // 3,5,7
        else if(x % 3 == 0)return false; x == 2 x 2 return true; // 2 true if(x % 2 == 0)return false;
        else if(x <= 7)return true; // 3,5,7
        else if(x % 3 == 0)return false; x % 2 == 0 x % 2 x 2 0 return false; false if(x <= 7)return true; // 3,5,7
        else if(x % 3 == 0)return false; x <= 7 x 7 return true; // 3,5,7 true if(x % 3 == 0)return false; x % 3 == 0 x % 3 x 3 0 return false; false for(int i=5; i*i<=x; i+=6){
            if(x % i == 0)return false;
            if(x % (i + 2) == 0)return false;
        } int i=5; int i=5; i 5 i*i<=x i*i i i x i+=6 i+=6 i 6 {
            if(x % i == 0)return false;
            if(x % (i + 2) == 0)return false;
        } {
            if(x % i == 0)return false;
            if(x % (i + 2) == 0)return false;
        } if(x % i == 0)return false; x % i == 0 x % i x i 0 return false; false if(x % (i + 2) == 0)return false; x % (i + 2) == 0 x % (i + 2) x (i + 2) i 2 0 return false; false return true; true int x x
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int cnt = 0;
        for(int i=0;i<n;i++){
            if(isPrime(Integer.parseInt(br.readLine())))cnt++;
        }
        System.out.println(cnt);
    }
    public static boolean isPrime(int x){
        if(x == 2)return true; // 2
        else if(x % 2 == 0)return false;
        else if(x <= 7)return true; // 3,5,7
        else if(x % 3 == 0)return false;

        for(int i=5; i*i<=x; i+=6){
            if(x % i == 0)return false;
            if(x % (i + 2) == 0)return false;
        }
        return true;
    }
}