import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = Integer.valueOf(scan.next());
        int cnt = 0;
        for(int i=0;i<n;i++) {
        	cnt+=isPrime(Integer.valueOf(scan.next()));
        }
        System.out.println(cnt);
        scan.close();
    }
    public static int isPrime(int n) {
        if (n<2) {
        	return 0;
        }
        else if (n==2) {
        	return 1;
        }
        else if (n%2==0) {
        	return 0;
        }
        for (int i = 3; i <= Math.sqrt(n); i+=2){
            if (n%i==0){
                return 0;
            }
        }
        return 1;
    }
} import java.util.Scanner; Scanner java.util public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = Integer.valueOf(scan.next());
        int cnt = 0;
        for(int i=0;i<n;i++) {
        	cnt+=isPrime(Integer.valueOf(scan.next()));
        }
        System.out.println(cnt);
        scan.close();
    }
    public static int isPrime(int n) {
        if (n<2) {
        	return 0;
        }
        else if (n==2) {
        	return 1;
        }
        else if (n%2==0) {
        	return 0;
        }
        for (int i = 3; i <= Math.sqrt(n); i+=2){
            if (n%i==0){
                return 0;
            }
        }
        return 1;
    }
} Main public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = Integer.valueOf(scan.next());
        int cnt = 0;
        for(int i=0;i<n;i++) {
        	cnt+=isPrime(Integer.valueOf(scan.next()));
        }
        System.out.println(cnt);
        scan.close();
    } main {
        Scanner scan = new Scanner(System.in);
        int n = Integer.valueOf(scan.next());
        int cnt = 0;
        for(int i=0;i<n;i++) {
        	cnt+=isPrime(Integer.valueOf(scan.next()));
        }
        System.out.println(cnt);
        scan.close();
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = Integer.valueOf(scan.next()); n Integer.valueOf(scan.next()) Integer.valueOf Integer scan.next() scan.next scan int cnt = 0; cnt 0 for(int i=0;i<n;i++) {
        	cnt+=isPrime(Integer.valueOf(scan.next()));
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
        	cnt+=isPrime(Integer.valueOf(scan.next()));
        } {
        	cnt+=isPrime(Integer.valueOf(scan.next()));
        } cnt+=isPrime(Integer.valueOf(scan.next())) cnt isPrime(Integer.valueOf(scan.next())) isPrime Integer.valueOf(scan.next()) Integer.valueOf Integer scan.next() scan.next scan System.out.println(cnt) System.out.println System.out System System.out cnt scan.close() scan.close scan String[] args args public static int isPrime(int n) {
        if (n<2) {
        	return 0;
        }
        else if (n==2) {
        	return 1;
        }
        else if (n%2==0) {
        	return 0;
        }
        for (int i = 3; i <= Math.sqrt(n); i+=2){
            if (n%i==0){
                return 0;
            }
        }
        return 1;
    } isPrime {
        if (n<2) {
        	return 0;
        }
        else if (n==2) {
        	return 1;
        }
        else if (n%2==0) {
        	return 0;
        }
        for (int i = 3; i <= Math.sqrt(n); i+=2){
            if (n%i==0){
                return 0;
            }
        }
        return 1;
    } if (n<2) {
        	return 0;
        }
        else if (n==2) {
        	return 1;
        }
        else if (n%2==0) {
        	return 0;
        } n<2 n 2 {
        	return 0;
        } return 0; 0 if (n==2) {
        	return 1;
        }
        else if (n%2==0) {
        	return 0;
        } n==2 n 2 {
        	return 1;
        } return 1; 1 if (n%2==0) {
        	return 0;
        } n%2==0 n%2 n 2 0 {
        	return 0;
        } return 0; 0 for (int i = 3; i <= Math.sqrt(n); i+=2){
            if (n%i==0){
                return 0;
            }
        } int i = 3; int i = 3; i 3 i <= Math.sqrt(n) i Math.sqrt(n) Math.sqrt Math n i+=2 i+=2 i 2 {
            if (n%i==0){
                return 0;
            }
        } {
            if (n%i==0){
                return 0;
            }
        } if (n%i==0){
                return 0;
            } n%i==0 n%i n i 0 {
                return 0;
            } return 0; 0 return 1; 1 int n n public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = Integer.valueOf(scan.next());
        int cnt = 0;
        for(int i=0;i<n;i++) {
        	cnt+=isPrime(Integer.valueOf(scan.next()));
        }
        System.out.println(cnt);
        scan.close();
    }
    public static int isPrime(int n) {
        if (n<2) {
        	return 0;
        }
        else if (n==2) {
        	return 1;
        }
        else if (n%2==0) {
        	return 0;
        }
        for (int i = 3; i <= Math.sqrt(n); i+=2){
            if (n%i==0){
                return 0;
            }
        }
        return 1;
    }
} public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = Integer.valueOf(scan.next());
        int cnt = 0;
        for(int i=0;i<n;i++) {
        	cnt+=isPrime(Integer.valueOf(scan.next()));
        }
        System.out.println(cnt);
        scan.close();
    }
    public static int isPrime(int n) {
        if (n<2) {
        	return 0;
        }
        else if (n==2) {
        	return 1;
        }
        else if (n%2==0) {
        	return 0;
        }
        for (int i = 3; i <= Math.sqrt(n); i+=2){
            if (n%i==0){
                return 0;
            }
        }
        return 1;
    }
} Main
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = Integer.valueOf(scan.next());
        int cnt = 0;
        for(int i=0;i<n;i++) {
        	cnt+=isPrime(Integer.valueOf(scan.next()));
        }
        System.out.println(cnt);
        scan.close();
    }
    public static int isPrime(int n) {
        if (n<2) {
        	return 0;
        }
        else if (n==2) {
        	return 1;
        }
        else if (n%2==0) {
        	return 0;
        }
        for (int i = 3; i <= Math.sqrt(n); i+=2){
            if (n%i==0){
                return 0;
            }
        }
        return 1;
    }
}
