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

public class Main {
    public static void main(String[] args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            int loop = Integer.parseInt(br.readLine());

            int[] nums = new int[loop];
            for(int i=0; i<loop; i++){
                nums[i] = Integer.parseInt(br.readLine());
            }
            
            int count = 0;
            for(int i=0; i<loop; i++){
                if(isPrime(nums[i])){
                    // System.out.println(String.valueOf(arr[i]));
                    count++;
                }
            }
            System.out.println(String.valueOf(count));
        } catch(IOException e){
            e.printStackTrace();
        }
    }
    
    static boolean isPrime(int x){
        if((x%2==0&&x!=2) || (x%3==0&&x!=3) || (x%5==0&&x!=5) || (x%7==0&&x!=7)){
            return false;
        }
        for(int i=2; i<(int)Math.sqrt(x)+1; i++){
            if(x%i==0){
                return false;
            }
        }
        return true;
    }
}
 import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.IOException; IOException java.io public class Main {
    public static void main(String[] args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            int loop = Integer.parseInt(br.readLine());

            int[] nums = new int[loop];
            for(int i=0; i<loop; i++){
                nums[i] = Integer.parseInt(br.readLine());
            }
            
            int count = 0;
            for(int i=0; i<loop; i++){
                if(isPrime(nums[i])){
                    // System.out.println(String.valueOf(arr[i]));
                    count++;
                }
            }
            System.out.println(String.valueOf(count));
        } catch(IOException e){
            e.printStackTrace();
        }
    }
    
    static boolean isPrime(int x){
        if((x%2==0&&x!=2) || (x%3==0&&x!=3) || (x%5==0&&x!=5) || (x%7==0&&x!=7)){
            return false;
        }
        for(int i=2; i<(int)Math.sqrt(x)+1; i++){
            if(x%i==0){
                return false;
            }
        }
        return true;
    }
} Main public static void main(String[] args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            int loop = Integer.parseInt(br.readLine());

            int[] nums = new int[loop];
            for(int i=0; i<loop; i++){
                nums[i] = Integer.parseInt(br.readLine());
            }
            
            int count = 0;
            for(int i=0; i<loop; i++){
                if(isPrime(nums[i])){
                    // System.out.println(String.valueOf(arr[i]));
                    count++;
                }
            }
            System.out.println(String.valueOf(count));
        } catch(IOException e){
            e.printStackTrace();
        }
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            int loop = Integer.parseInt(br.readLine());

            int[] nums = new int[loop];
            for(int i=0; i<loop; i++){
                nums[i] = Integer.parseInt(br.readLine());
            }
            
            int count = 0;
            for(int i=0; i<loop; i++){
                if(isPrime(nums[i])){
                    // System.out.println(String.valueOf(arr[i]));
                    count++;
                }
            }
            System.out.println(String.valueOf(count));
        } catch(IOException e){
            e.printStackTrace();
        }
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) try {
            int loop = Integer.parseInt(br.readLine());

            int[] nums = new int[loop];
            for(int i=0; i<loop; i++){
                nums[i] = Integer.parseInt(br.readLine());
            }
            
            int count = 0;
            for(int i=0; i<loop; i++){
                if(isPrime(nums[i])){
                    // System.out.println(String.valueOf(arr[i]));
                    count++;
                }
            }
            System.out.println(String.valueOf(count));
        } catch(IOException e){
            e.printStackTrace();
        } catch(IOException e){
            e.printStackTrace();
        } IOException e {
            e.printStackTrace();
        } e.printStackTrace() e.printStackTrace e {
            int loop = Integer.parseInt(br.readLine());

            int[] nums = new int[loop];
            for(int i=0; i<loop; i++){
                nums[i] = Integer.parseInt(br.readLine());
            }
            
            int count = 0;
            for(int i=0; i<loop; i++){
                if(isPrime(nums[i])){
                    // System.out.println(String.valueOf(arr[i]));
                    count++;
                }
            }
            System.out.println(String.valueOf(count));
        } int loop = Integer.parseInt(br.readLine()); loop Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int[] nums = new int[loop]; nums new int[loop] loop for(int i=0; i<loop; i++){
                nums[i] = Integer.parseInt(br.readLine());
            } int i=0; int i=0; i 0 i<loop i loop i++ i++ i {
                nums[i] = Integer.parseInt(br.readLine());
            } {
                nums[i] = Integer.parseInt(br.readLine());
            } nums[i] = Integer.parseInt(br.readLine()) nums[i] nums i Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int count = 0; count 0 for(int i=0; i<loop; i++){
                if(isPrime(nums[i])){
                    // System.out.println(String.valueOf(arr[i]));
                    count++;
                }
            } int i=0; int i=0; i 0 i<loop i loop i++ i++ i {
                if(isPrime(nums[i])){
                    // System.out.println(String.valueOf(arr[i]));
                    count++;
                }
            } {
                if(isPrime(nums[i])){
                    // System.out.println(String.valueOf(arr[i]));
                    count++;
                }
            } if(isPrime(nums[i])){
                    // System.out.println(String.valueOf(arr[i]));
                    count++;
                } isPrime(nums[i]) isPrime nums[i] nums i {
                    // System.out.println(String.valueOf(arr[i]));
                    count++;
                } count++ count System.out.println(String.valueOf(count)) System.out.println System.out System System.out String.valueOf(count) String.valueOf String count String[] args args static boolean isPrime(int x){
        if((x%2==0&&x!=2) || (x%3==0&&x!=3) || (x%5==0&&x!=5) || (x%7==0&&x!=7)){
            return false;
        }
        for(int i=2; i<(int)Math.sqrt(x)+1; i++){
            if(x%i==0){
                return false;
            }
        }
        return true;
    } isPrime {
        if((x%2==0&&x!=2) || (x%3==0&&x!=3) || (x%5==0&&x!=5) || (x%7==0&&x!=7)){
            return false;
        }
        for(int i=2; i<(int)Math.sqrt(x)+1; i++){
            if(x%i==0){
                return false;
            }
        }
        return true;
    } if((x%2==0&&x!=2) || (x%3==0&&x!=3) || (x%5==0&&x!=5) || (x%7==0&&x!=7)){
            return false;
        } (x%2==0&&x!=2) || (x%3==0&&x!=3) || (x%5==0&&x!=5) || (x%7==0&&x!=7) (x%5==0&&x!=5) (x%2==0&&x!=2) || (x%3==0&&x!=3) || (x%5==0&&x!=5) || (x%7==0&&x!=7) (x%2==0&&x!=2) x%2==0 x%2 x 2 0 x!=2 x 2 (x%3==0&&x!=3) x%3==0 x%3 x 3 0 x!=3 x 3 (x%5==0&&x!=5) x%5==0 x%5 x 5 0 x!=5 x 5 (x%7==0&&x!=7) x%7==0 x%7 x 7 0 x!=7 x 7 {
            return false;
        } return false; false for(int i=2; i<(int)Math.sqrt(x)+1; i++){
            if(x%i==0){
                return false;
            }
        } int i=2; int i=2; i 2 i<(int)Math.sqrt(x)+1 i (int)Math.sqrt(x)+1 (int)Math.sqrt(x) Math.sqrt Math x 1 i++ i++ i {
            if(x%i==0){
                return false;
            }
        } {
            if(x%i==0){
                return false;
            }
        } if(x%i==0){
                return false;
            } x%i==0 x%i x i 0 {
                return false;
            } return false; false return true; true int x x public class Main {
    public static void main(String[] args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            int loop = Integer.parseInt(br.readLine());

            int[] nums = new int[loop];
            for(int i=0; i<loop; i++){
                nums[i] = Integer.parseInt(br.readLine());
            }
            
            int count = 0;
            for(int i=0; i<loop; i++){
                if(isPrime(nums[i])){
                    // System.out.println(String.valueOf(arr[i]));
                    count++;
                }
            }
            System.out.println(String.valueOf(count));
        } catch(IOException e){
            e.printStackTrace();
        }
    }
    
    static boolean isPrime(int x){
        if((x%2==0&&x!=2) || (x%3==0&&x!=3) || (x%5==0&&x!=5) || (x%7==0&&x!=7)){
            return false;
        }
        for(int i=2; i<(int)Math.sqrt(x)+1; i++){
            if(x%i==0){
                return false;
            }
        }
        return true;
    }
} public class Main {
    public static void main(String[] args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            int loop = Integer.parseInt(br.readLine());

            int[] nums = new int[loop];
            for(int i=0; i<loop; i++){
                nums[i] = Integer.parseInt(br.readLine());
            }
            
            int count = 0;
            for(int i=0; i<loop; i++){
                if(isPrime(nums[i])){
                    // System.out.println(String.valueOf(arr[i]));
                    count++;
                }
            }
            System.out.println(String.valueOf(count));
        } catch(IOException e){
            e.printStackTrace();
        }
    }
    
    static boolean isPrime(int x){
        if((x%2==0&&x!=2) || (x%3==0&&x!=3) || (x%5==0&&x!=5) || (x%7==0&&x!=7)){
            return false;
        }
        for(int i=2; i<(int)Math.sqrt(x)+1; i++){
            if(x%i==0){
                return false;
            }
        }
        return true;
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
    public static void main(String[] args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            int loop = Integer.parseInt(br.readLine());

            int[] nums = new int[loop];
            for(int i=0; i<loop; i++){
                nums[i] = Integer.parseInt(br.readLine());
            }
            
            int count = 0;
            for(int i=0; i<loop; i++){
                if(isPrime(nums[i])){
                    // System.out.println(String.valueOf(arr[i]));
                    count++;
                }
            }
            System.out.println(String.valueOf(count));
        } catch(IOException e){
            e.printStackTrace();
        }
    }
    
    static boolean isPrime(int x){
        if((x%2==0&&x!=2) || (x%3==0&&x!=3) || (x%5==0&&x!=5) || (x%7==0&&x!=7)){
            return false;
        }
        for(int i=2; i<(int)Math.sqrt(x)+1; i++){
            if(x%i==0){
                return false;
            }
        }
        return true;
    }
}

