import java.util.Scanner;

public class Main {
    
    public static void main (String... args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.nextLine());
        
        int count = 0;
        for (int i=0; i<n; i++) {
            int a = Integer.parseInt(scanner.nextLine());
            
            if (isPrime(a)) {
                count++;
            }
        }
        System.out.println(count + "");
    }
    
    private static boolean isPrime(int a) {
        if (a == 2) {
            return true;
        } else if (a < 2 || a%2 == 0) {
            return false;
        } else {
            for (int i = 3; i <= Math.sqrt(a); i = i + 2) {
                if (a % i == 0) {
                    return false;
                }
            }
            return true;
        }
    }
}
 import java.util.Scanner; Scanner java.util public class Main {
    
    public static void main (String... args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.nextLine());
        
        int count = 0;
        for (int i=0; i<n; i++) {
            int a = Integer.parseInt(scanner.nextLine());
            
            if (isPrime(a)) {
                count++;
            }
        }
        System.out.println(count + "");
    }
    
    private static boolean isPrime(int a) {
        if (a == 2) {
            return true;
        } else if (a < 2 || a%2 == 0) {
            return false;
        } else {
            for (int i = 3; i <= Math.sqrt(a); i = i + 2) {
                if (a % i == 0) {
                    return false;
                }
            }
            return true;
        }
    }
} Main public static void main (String... args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.nextLine());
        
        int count = 0;
        for (int i=0; i<n; i++) {
            int a = Integer.parseInt(scanner.nextLine());
            
            if (isPrime(a)) {
                count++;
            }
        }
        System.out.println(count + "");
    } main {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.nextLine());
        
        int count = 0;
        for (int i=0; i<n; i++) {
            int a = Integer.parseInt(scanner.nextLine());
            
            if (isPrime(a)) {
                count++;
            }
        }
        System.out.println(count + "");
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = Integer.parseInt(scanner.nextLine()); n Integer.parseInt(scanner.nextLine()) Integer.parseInt Integer scanner.nextLine() scanner.nextLine scanner int count = 0; count 0 for (int i=0; i<n; i++) {
            int a = Integer.parseInt(scanner.nextLine());
            
            if (isPrime(a)) {
                count++;
            }
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            int a = Integer.parseInt(scanner.nextLine());
            
            if (isPrime(a)) {
                count++;
            }
        } {
            int a = Integer.parseInt(scanner.nextLine());
            
            if (isPrime(a)) {
                count++;
            }
        } int a = Integer.parseInt(scanner.nextLine()); a Integer.parseInt(scanner.nextLine()) Integer.parseInt Integer scanner.nextLine() scanner.nextLine scanner if (isPrime(a)) {
                count++;
            } isPrime(a) isPrime a {
                count++;
            } count++ count System.out.println(count + "") System.out.println System.out System System.out count + "" count "" String... args args private static boolean isPrime(int a) {
        if (a == 2) {
            return true;
        } else if (a < 2 || a%2 == 0) {
            return false;
        } else {
            for (int i = 3; i <= Math.sqrt(a); i = i + 2) {
                if (a % i == 0) {
                    return false;
                }
            }
            return true;
        }
    } isPrime {
        if (a == 2) {
            return true;
        } else if (a < 2 || a%2 == 0) {
            return false;
        } else {
            for (int i = 3; i <= Math.sqrt(a); i = i + 2) {
                if (a % i == 0) {
                    return false;
                }
            }
            return true;
        }
    } if (a == 2) {
            return true;
        } else if (a < 2 || a%2 == 0) {
            return false;
        } else {
            for (int i = 3; i <= Math.sqrt(a); i = i + 2) {
                if (a % i == 0) {
                    return false;
                }
            }
            return true;
        } a == 2 a 2 {
            return true;
        } return true; true if (a < 2 || a%2 == 0) {
            return false;
        } else {
            for (int i = 3; i <= Math.sqrt(a); i = i + 2) {
                if (a % i == 0) {
                    return false;
                }
            }
            return true;
        } a < 2 || a%2 == 0 a < 2 a 2 a%2 == 0 a%2 a 2 0 {
            return false;
        } return false; false {
            for (int i = 3; i <= Math.sqrt(a); i = i + 2) {
                if (a % i == 0) {
                    return false;
                }
            }
            return true;
        } for (int i = 3; i <= Math.sqrt(a); i = 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 = i + 2 i = i + 2 i 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 class Main {
    
    public static void main (String... args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.nextLine());
        
        int count = 0;
        for (int i=0; i<n; i++) {
            int a = Integer.parseInt(scanner.nextLine());
            
            if (isPrime(a)) {
                count++;
            }
        }
        System.out.println(count + "");
    }
    
    private static boolean isPrime(int a) {
        if (a == 2) {
            return true;
        } else if (a < 2 || a%2 == 0) {
            return false;
        } else {
            for (int i = 3; i <= Math.sqrt(a); i = i + 2) {
                if (a % i == 0) {
                    return false;
                }
            }
            return true;
        }
    }
} public class Main {
    
    public static void main (String... args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.nextLine());
        
        int count = 0;
        for (int i=0; i<n; i++) {
            int a = Integer.parseInt(scanner.nextLine());
            
            if (isPrime(a)) {
                count++;
            }
        }
        System.out.println(count + "");
    }
    
    private static boolean isPrime(int a) {
        if (a == 2) {
            return true;
        } else if (a < 2 || a%2 == 0) {
            return false;
        } else {
            for (int i = 3; i <= Math.sqrt(a); i = i + 2) {
                if (a % i == 0) {
                    return false;
                }
            }
            return true;
        }
    }
} Main
import java.util.Scanner;

public class Main {
    
    public static void main (String... args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.nextLine());
        
        int count = 0;
        for (int i=0; i<n; i++) {
            int a = Integer.parseInt(scanner.nextLine());
            
            if (isPrime(a)) {
                count++;
            }
        }
        System.out.println(count + "");
    }
    
    private static boolean isPrime(int a) {
        if (a == 2) {
            return true;
        } else if (a < 2 || a%2 == 0) {
            return false;
        } else {
            for (int i = 3; i <= Math.sqrt(a); i = i + 2) {
                if (a % i == 0) {
                    return false;
                }
            }
            return true;
        }
    }
}

