import java.util.*;
import java.io.*;
public class Main{

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

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

    }
    //素数判定
    public static boolean isPrime(int x){
        if(x == 2) return true;
        if(x < 2 || x % 2 == 0) return false;
        
        int i = 3;
        while(i <= Math.sqrt(x)){
            if(x % i == 0) return false;
            i = i + 2;
        }
        return true;
    }
}
 import java.util.*; util.* java import java.io.*; io.* java public class Main{

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

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

    }
    //素数判定
    public static boolean isPrime(int x){
        if(x == 2) return true;
        if(x < 2 || x % 2 == 0) return false;
        
        int i = 3;
        while(i <= Math.sqrt(x)){
            if(x % i == 0) return false;
            i = i + 2;
        }
        return true;
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

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

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

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

    } 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 count=0; count 0 for(int i=0; i<n; i++){
            if(isPrime(Integer.parseInt(sc.next()))) count++;
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            if(isPrime(Integer.parseInt(sc.next()))) count++;
        } {
            if(isPrime(Integer.parseInt(sc.next()))) count++;
        } if(isPrime(Integer.parseInt(sc.next()))) count++; isPrime(Integer.parseInt(sc.next())) isPrime Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args //素数判定
    public static boolean isPrime(int x){
        if(x == 2) return true;
        if(x < 2 || x % 2 == 0) return false;
        
        int i = 3;
        while(i <= Math.sqrt(x)){
            if(x % i == 0) return false;
            i = i + 2;
        }
        return true;
    } isPrime {
        if(x == 2) return true;
        if(x < 2 || x % 2 == 0) return false;
        
        int i = 3;
        while(i <= Math.sqrt(x)){
            if(x % i == 0) return false;
            i = i + 2;
        }
        return true;
    } if(x == 2) return true; x == 2 x 2 return true; true if(x < 2 || x % 2 == 0) return false; x < 2 || x % 2 == 0 x < 2 x 2 x % 2 == 0 x % 2 x 2 0 return false; false int i = 3; i 3 while(i <= Math.sqrt(x)){
            if(x % i == 0) return false;
            i = i + 2;
        } i <= Math.sqrt(x) i Math.sqrt(x) Math.sqrt Math x {
            if(x % i == 0) return false;
            i = i + 2;
        } if(x % i == 0) return false; x % i == 0 x % i x i 0 return false; false i = i + 2 i i + 2 i 2 return true; true int x x public class Main{

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

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

    }
    //素数判定
    public static boolean isPrime(int x){
        if(x == 2) return true;
        if(x < 2 || x % 2 == 0) return false;
        
        int i = 3;
        while(i <= Math.sqrt(x)){
            if(x % i == 0) return false;
            i = i + 2;
        }
        return true;
    }
} public class Main{

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

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

    }
    //素数判定
    public static boolean isPrime(int x){
        if(x == 2) return true;
        if(x < 2 || x % 2 == 0) return false;
        
        int i = 3;
        while(i <= Math.sqrt(x)){
            if(x % i == 0) return false;
            i = i + 2;
        }
        return true;
    }
} Main
import java.util.*;
import java.io.*;
public class Main{

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

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

    }
    //素数判定
    public static boolean isPrime(int x){
        if(x == 2) return true;
        if(x < 2 || x % 2 == 0) return false;
        
        int i = 3;
        while(i <= Math.sqrt(x)){
            if(x % i == 0) return false;
            i = i + 2;
        }
        return true;
    }
}

