import java.util.Scanner;

class Main{

    static boolean isPrime(int n){
        if(n == 2){
            return true;
        }else if(n < 2 || n % 2 == 0){
            return false;
        }else{
            int x = 3;
            while(x <= Math.sqrt((double)n)){
                if(n%x == 0)    return false;
                x += 2;
            }
            return true;
        }
    }
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int n = Integer.parseInt(sc.next());
        int result = 0;

        for(int i = 0; i < n; i++){
            if(isPrime(Integer.parseInt(sc.next()))) result++;
        }

        System.out.println(result);
    }
} import java.util.Scanner; Scanner java.util class Main{

    static boolean isPrime(int n){
        if(n == 2){
            return true;
        }else if(n < 2 || n % 2 == 0){
            return false;
        }else{
            int x = 3;
            while(x <= Math.sqrt((double)n)){
                if(n%x == 0)    return false;
                x += 2;
            }
            return true;
        }
    }
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int n = Integer.parseInt(sc.next());
        int result = 0;

        for(int i = 0; i < n; i++){
            if(isPrime(Integer.parseInt(sc.next()))) result++;
        }

        System.out.println(result);
    }
} Main static boolean isPrime(int n){
        if(n == 2){
            return true;
        }else if(n < 2 || n % 2 == 0){
            return false;
        }else{
            int x = 3;
            while(x <= Math.sqrt((double)n)){
                if(n%x == 0)    return false;
                x += 2;
            }
            return true;
        }
    } isPrime {
        if(n == 2){
            return true;
        }else if(n < 2 || n % 2 == 0){
            return false;
        }else{
            int x = 3;
            while(x <= Math.sqrt((double)n)){
                if(n%x == 0)    return false;
                x += 2;
            }
            return true;
        }
    } if(n == 2){
            return true;
        }else if(n < 2 || n % 2 == 0){
            return false;
        }else{
            int x = 3;
            while(x <= Math.sqrt((double)n)){
                if(n%x == 0)    return false;
                x += 2;
            }
            return true;
        } n == 2 n 2 {
            return true;
        } return true; true if(n < 2 || n % 2 == 0){
            return false;
        }else{
            int x = 3;
            while(x <= Math.sqrt((double)n)){
                if(n%x == 0)    return false;
                x += 2;
            }
            return true;
        } n < 2 || n % 2 == 0 n < 2 n 2 n % 2 == 0 n % 2 n 2 0 {
            return false;
        } return false; false {
            int x = 3;
            while(x <= Math.sqrt((double)n)){
                if(n%x == 0)    return false;
                x += 2;
            }
            return true;
        } int x = 3; x 3 while(x <= Math.sqrt((double)n)){
                if(n%x == 0)    return false;
                x += 2;
            } x <= Math.sqrt((double)n) x Math.sqrt((double)n) Math.sqrt Math (double)n {
                if(n%x == 0)    return false;
                x += 2;
            } if(n%x == 0)    return false; n%x == 0 n%x n x 0 return false; false x += 2 x 2 return true; true int n n public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int n = Integer.parseInt(sc.next());
        int result = 0;

        for(int i = 0; i < n; i++){
            if(isPrime(Integer.parseInt(sc.next()))) result++;
        }

        System.out.println(result);
    } main {
        Scanner sc = new Scanner(System.in);

        int n = Integer.parseInt(sc.next());
        int result = 0;

        for(int i = 0; i < n; i++){
            if(isPrime(Integer.parseInt(sc.next()))) result++;
        }

        System.out.println(result);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int result = 0; result 0 for(int i = 0; i < n; i++){
            if(isPrime(Integer.parseInt(sc.next()))) result++;
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            if(isPrime(Integer.parseInt(sc.next()))) result++;
        } {
            if(isPrime(Integer.parseInt(sc.next()))) result++;
        } if(isPrime(Integer.parseInt(sc.next()))) result++; isPrime(Integer.parseInt(sc.next())) isPrime Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc result++ result System.out.println(result) System.out.println System.out System System.out result String[] args args
import java.util.Scanner;

class Main{

    static boolean isPrime(int n){
        if(n == 2){
            return true;
        }else if(n < 2 || n % 2 == 0){
            return false;
        }else{
            int x = 3;
            while(x <= Math.sqrt((double)n)){
                if(n%x == 0)    return false;
                x += 2;
            }
            return true;
        }
    }
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int n = Integer.parseInt(sc.next());
        int result = 0;

        for(int i = 0; i < n; i++){
            if(isPrime(Integer.parseInt(sc.next()))) result++;
        }

        System.out.println(result);
    }
}
