import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        PrimeNumber PN = new PrimeNumber();
        
        while(0 < a){
            if(PN.getPN(sc.nextInt())){
                PN.result++;
            }
            a--;
        }
        System.out.println(PN.getResult());
    }
}

class PrimeNumber{
    int result = 0;
    
    public boolean getPN(int a){
        if(a == 2){
            return true;
        }
        if(a < 2 || a % 2 == 0){
            return false;
        }
        
        int k = 3;
        for(int i = 3; i <= Math.sqrt(a); i += 2){
            if(a % i == 0){
                return false;
            }
        }
        return true;
    }
    
    public int getResult(){
        return result;
    }
}
 import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        PrimeNumber PN = new PrimeNumber();
        
        while(0 < a){
            if(PN.getPN(sc.nextInt())){
                PN.result++;
            }
            a--;
        }
        System.out.println(PN.getResult());
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        PrimeNumber PN = new PrimeNumber();
        
        while(0 < a){
            if(PN.getPN(sc.nextInt())){
                PN.result++;
            }
            a--;
        }
        System.out.println(PN.getResult());
    } main {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        PrimeNumber PN = new PrimeNumber();
        
        while(0 < a){
            if(PN.getPN(sc.nextInt())){
                PN.result++;
            }
            a--;
        }
        System.out.println(PN.getResult());
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc PrimeNumber PN = new PrimeNumber(); PN new PrimeNumber() while(0 < a){
            if(PN.getPN(sc.nextInt())){
                PN.result++;
            }
            a--;
        } 0 < a 0 a {
            if(PN.getPN(sc.nextInt())){
                PN.result++;
            }
            a--;
        } if(PN.getPN(sc.nextInt())){
                PN.result++;
            } PN.getPN(sc.nextInt()) PN.getPN PN sc.nextInt() sc.nextInt sc {
                PN.result++;
            } PN.result++ PN.result PN PN.result a-- a System.out.println(PN.getResult()) System.out.println System.out System System.out PN.getResult() PN.getResult PN String[] args args class PrimeNumber{
    int result = 0;
    
    public boolean getPN(int a){
        if(a == 2){
            return true;
        }
        if(a < 2 || a % 2 == 0){
            return false;
        }
        
        int k = 3;
        for(int i = 3; i <= Math.sqrt(a); i += 2){
            if(a % i == 0){
                return false;
            }
        }
        return true;
    }
    
    public int getResult(){
        return result;
    }
} PrimeNumber int result = 0; result 0 public boolean getPN(int a){
        if(a == 2){
            return true;
        }
        if(a < 2 || a % 2 == 0){
            return false;
        }
        
        int k = 3;
        for(int i = 3; i <= Math.sqrt(a); i += 2){
            if(a % i == 0){
                return false;
            }
        }
        return true;
    } getPN {
        if(a == 2){
            return true;
        }
        if(a < 2 || a % 2 == 0){
            return false;
        }
        
        int k = 3;
        for(int i = 3; i <= Math.sqrt(a); i += 2){
            if(a % i == 0){
                return false;
            }
        }
        return true;
    } if(a == 2){
            return true;
        } 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 int k = 3; k 3 for(int i = 3; i <= Math.sqrt(a); i += 2){
            if(a % i == 0){
                return false;
            }
        } int i = 3; int i = 3; i 3 i <= Math.sqrt(a) i Math.sqrt(a) Math.sqrt Math a 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 int a a public int getResult(){
        return result;
    } getResult {
        return result;
    } return result; result public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        PrimeNumber PN = new PrimeNumber();
        
        while(0 < a){
            if(PN.getPN(sc.nextInt())){
                PN.result++;
            }
            a--;
        }
        System.out.println(PN.getResult());
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        PrimeNumber PN = new PrimeNumber();
        
        while(0 < a){
            if(PN.getPN(sc.nextInt())){
                PN.result++;
            }
            a--;
        }
        System.out.println(PN.getResult());
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        PrimeNumber PN = new PrimeNumber();
        
        while(0 < a){
            if(PN.getPN(sc.nextInt())){
                PN.result++;
            }
            a--;
        }
        System.out.println(PN.getResult());
    }
}

class PrimeNumber{
    int result = 0;
    
    public boolean getPN(int a){
        if(a == 2){
            return true;
        }
        if(a < 2 || a % 2 == 0){
            return false;
        }
        
        int k = 3;
        for(int i = 3; i <= Math.sqrt(a); i += 2){
            if(a % i == 0){
                return false;
            }
        }
        return true;
    }
    
    public int getResult(){
        return result;
    }
}

