import java.util.Scanner;
import java.util.*;

public class Main{

   static boolean Sosu(int p){
        int count=0;
        if(p==1) return false;
        else if(p==2) return true;
        else {
            for (int i=2;i<Math.sqrt(p)+1;i++){
            if(p%i==0) count++;
        }
        if(count==0) return true;
        else return false;
    }
   }
    public static void main(String[] args){
        int count=0;
        ArrayList<Integer> list =new ArrayList<Integer>();
        Scanner sc = new Scanner(System.in);
        int a= sc.nextInt();
        for(int i=0;i<a;i++){
        int b =sc.nextInt();
        list.add(b);
        }
        for(int i=0;i<list.size();i++){
            if(Sosu(list.get(i))==true) count++; 
        }
        System.out.println(count);
        }
}

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

   static boolean Sosu(int p){
        int count=0;
        if(p==1) return false;
        else if(p==2) return true;
        else {
            for (int i=2;i<Math.sqrt(p)+1;i++){
            if(p%i==0) count++;
        }
        if(count==0) return true;
        else return false;
    }
   }
    public static void main(String[] args){
        int count=0;
        ArrayList<Integer> list =new ArrayList<Integer>();
        Scanner sc = new Scanner(System.in);
        int a= sc.nextInt();
        for(int i=0;i<a;i++){
        int b =sc.nextInt();
        list.add(b);
        }
        for(int i=0;i<list.size();i++){
            if(Sosu(list.get(i))==true) count++; 
        }
        System.out.println(count);
        }
} Main static boolean Sosu(int p){
        int count=0;
        if(p==1) return false;
        else if(p==2) return true;
        else {
            for (int i=2;i<Math.sqrt(p)+1;i++){
            if(p%i==0) count++;
        }
        if(count==0) return true;
        else return false;
    }
   } Sosu {
        int count=0;
        if(p==1) return false;
        else if(p==2) return true;
        else {
            for (int i=2;i<Math.sqrt(p)+1;i++){
            if(p%i==0) count++;
        }
        if(count==0) return true;
        else return false;
    }
   } int count=0; count 0 if(p==1) return false;
        else if(p==2) return true;
        else {
            for (int i=2;i<Math.sqrt(p)+1;i++){
            if(p%i==0) count++;
        }
        if(count==0) return true;
        else return false;
    } p==1 p 1 return false; false if(p==2) return true;
        else {
            for (int i=2;i<Math.sqrt(p)+1;i++){
            if(p%i==0) count++;
        }
        if(count==0) return true;
        else return false;
    } p==2 p 2 return true; true {
            for (int i=2;i<Math.sqrt(p)+1;i++){
            if(p%i==0) count++;
        }
        if(count==0) return true;
        else return false;
    } for (int i=2;i<Math.sqrt(p)+1;i++){
            if(p%i==0) count++;
        } int i=2; int i=2; i 2 i<Math.sqrt(p)+1 i Math.sqrt(p)+1 Math.sqrt(p) Math.sqrt Math p 1 i++ i++ i {
            if(p%i==0) count++;
        } {
            if(p%i==0) count++;
        } if(p%i==0) count++; p%i==0 p%i p i 0 count++ count if(count==0) return true;
        else return false; count==0 count 0 return true; true return false; false int p p public static void main(String[] args){
        int count=0;
        ArrayList<Integer> list =new ArrayList<Integer>();
        Scanner sc = new Scanner(System.in);
        int a= sc.nextInt();
        for(int i=0;i<a;i++){
        int b =sc.nextInt();
        list.add(b);
        }
        for(int i=0;i<list.size();i++){
            if(Sosu(list.get(i))==true) count++; 
        }
        System.out.println(count);
        } main {
        int count=0;
        ArrayList<Integer> list =new ArrayList<Integer>();
        Scanner sc = new Scanner(System.in);
        int a= sc.nextInt();
        for(int i=0;i<a;i++){
        int b =sc.nextInt();
        list.add(b);
        }
        for(int i=0;i<list.size();i++){
            if(Sosu(list.get(i))==true) count++; 
        }
        System.out.println(count);
        } int count=0; count 0 ArrayList<Integer> list =new ArrayList<Integer>(); list new ArrayList<Integer>() Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a= sc.nextInt(); a sc.nextInt() sc.nextInt sc for(int i=0;i<a;i++){
        int b =sc.nextInt();
        list.add(b);
        } int i=0; int i=0; i 0 i<a i a i++ i++ i {
        int b =sc.nextInt();
        list.add(b);
        } {
        int b =sc.nextInt();
        list.add(b);
        } int b =sc.nextInt(); b sc.nextInt() sc.nextInt sc list.add(b) list.add list b for(int i=0;i<list.size();i++){
            if(Sosu(list.get(i))==true) count++; 
        } int i=0; int i=0; i 0 i<list.size() i list.size() list.size list i++ i++ i {
            if(Sosu(list.get(i))==true) count++; 
        } {
            if(Sosu(list.get(i))==true) count++; 
        } if(Sosu(list.get(i))==true) count++; Sosu(list.get(i))==true Sosu(list.get(i)) Sosu list.get(i) list.get list i true count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main{

   static boolean Sosu(int p){
        int count=0;
        if(p==1) return false;
        else if(p==2) return true;
        else {
            for (int i=2;i<Math.sqrt(p)+1;i++){
            if(p%i==0) count++;
        }
        if(count==0) return true;
        else return false;
    }
   }
    public static void main(String[] args){
        int count=0;
        ArrayList<Integer> list =new ArrayList<Integer>();
        Scanner sc = new Scanner(System.in);
        int a= sc.nextInt();
        for(int i=0;i<a;i++){
        int b =sc.nextInt();
        list.add(b);
        }
        for(int i=0;i<list.size();i++){
            if(Sosu(list.get(i))==true) count++; 
        }
        System.out.println(count);
        }
} public class Main{

   static boolean Sosu(int p){
        int count=0;
        if(p==1) return false;
        else if(p==2) return true;
        else {
            for (int i=2;i<Math.sqrt(p)+1;i++){
            if(p%i==0) count++;
        }
        if(count==0) return true;
        else return false;
    }
   }
    public static void main(String[] args){
        int count=0;
        ArrayList<Integer> list =new ArrayList<Integer>();
        Scanner sc = new Scanner(System.in);
        int a= sc.nextInt();
        for(int i=0;i<a;i++){
        int b =sc.nextInt();
        list.add(b);
        }
        for(int i=0;i<list.size();i++){
            if(Sosu(list.get(i))==true) count++; 
        }
        System.out.println(count);
        }
} Main
import java.util.Scanner;
import java.util.*;

public class Main{

   static boolean Sosu(int p){
        int count=0;
        if(p==1) return false;
        else if(p==2) return true;
        else {
            for (int i=2;i<Math.sqrt(p)+1;i++){
            if(p%i==0) count++;
        }
        if(count==0) return true;
        else return false;
    }
   }
    public static void main(String[] args){
        int count=0;
        ArrayList<Integer> list =new ArrayList<Integer>();
        Scanner sc = new Scanner(System.in);
        int a= sc.nextInt();
        for(int i=0;i<a;i++){
        int b =sc.nextInt();
        list.add(b);
        }
        for(int i=0;i<list.size();i++){
            if(Sosu(list.get(i))==true) count++; 
        }
        System.out.println(count);
        }
}


