
import java.util.Scanner;

/**
 * Created by shoya on 2017/04/14.
 */
public class Main {
    public static void main(String... args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ans = 0;
        for (int i = 0; i < n; i++)
            ans += (isPrime(sc.nextInt())) ? 1 : 0;
        System.out.println(ans);
        return;
    }

    public static boolean isPrime(int n){
        int i = 2;
        while (i * i <= n) {
            if (n % i == 0)
                return false;
            i++;
        }
        return true;
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String... args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ans = 0;
        for (int i = 0; i < n; i++)
            ans += (isPrime(sc.nextInt())) ? 1 : 0;
        System.out.println(ans);
        return;
    }

    public static boolean isPrime(int n){
        int i = 2;
        while (i * i <= n) {
            if (n % i == 0)
                return false;
            i++;
        }
        return true;
    }
} Main public static void main(String... args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ans = 0;
        for (int i = 0; i < n; i++)
            ans += (isPrime(sc.nextInt())) ? 1 : 0;
        System.out.println(ans);
        return;
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ans = 0;
        for (int i = 0; i < n; i++)
            ans += (isPrime(sc.nextInt())) ? 1 : 0;
        System.out.println(ans);
        return;
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int ans = 0; ans 0 for (int i = 0; i < n; i++)
            ans += (isPrime(sc.nextInt())) ? 1 : 0; int i = 0; int i = 0; i 0 i < n i n i++ i++ i ans += (isPrime(sc.nextInt())) ? 1 : 0; ans += (isPrime(sc.nextInt())) ? 1 : 0 ans (isPrime(sc.nextInt())) ? 1 : 0 (isPrime(sc.nextInt())) isPrime sc.nextInt() sc.nextInt sc 1 0 System.out.println(ans) System.out.println System.out System System.out ans return; String... args args public static boolean isPrime(int n){
        int i = 2;
        while (i * i <= n) {
            if (n % i == 0)
                return false;
            i++;
        }
        return true;
    } isPrime {
        int i = 2;
        while (i * i <= n) {
            if (n % i == 0)
                return false;
            i++;
        }
        return true;
    } int i = 2; i 2 while (i * i <= n) {
            if (n % i == 0)
                return false;
            i++;
        } i * i <= n i * i i i n {
            if (n % i == 0)
                return false;
            i++;
        } if (n % i == 0)
                return false; n % i == 0 n % i n i 0 return false; false i++ i return true; true int n n public class Main {
    public static void main(String... args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ans = 0;
        for (int i = 0; i < n; i++)
            ans += (isPrime(sc.nextInt())) ? 1 : 0;
        System.out.println(ans);
        return;
    }

    public static boolean isPrime(int n){
        int i = 2;
        while (i * i <= n) {
            if (n % i == 0)
                return false;
            i++;
        }
        return true;
    }
} public class Main {
    public static void main(String... args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ans = 0;
        for (int i = 0; i < n; i++)
            ans += (isPrime(sc.nextInt())) ? 1 : 0;
        System.out.println(ans);
        return;
    }

    public static boolean isPrime(int n){
        int i = 2;
        while (i * i <= n) {
            if (n % i == 0)
                return false;
            i++;
        }
        return true;
    }
} Main

import java.util.Scanner;

/**
 * Created by shoya on 2017/04/14.
 */
public class Main {
    public static void main(String... args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ans = 0;
        for (int i = 0; i < n; i++)
            ans += (isPrime(sc.nextInt())) ? 1 : 0;
        System.out.println(ans);
        return;
    }

    public static boolean isPrime(int n){
        int i = 2;
        while (i * i <= n) {
            if (n % i == 0)
                return false;
            i++;
        }
        return true;
    }
}