import java.util.Scanner;

class Main { 
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        int count = 0;
        int borderline = 1000;
        
        boolean primes[] = new boolean [borderline];
        for(int n = 2; n < primes.length; n++){
            if(primes[n]) continue;
            for(int m = 2 * n; m < primes.length; m += n) {
                primes[m] = true;
            }
        }
        
        while (N != 0) {
            int num = in.nextInt();
            if       ((num >  borderline) && isPrime(num)) count++;
            else  if ((num <= borderline) && !primes[num]) count++;
            N--;
        }
        
        System.out.println(count);
    }
    
    public static boolean isPrime(int x) {
        if      (x == 2)     return true;
        else if (x % 2 == 0) return false;
        else {
            for (int i = 3; i * i <= x; i += 2) {
                if (x % i == 0) return false;
            }
            return true;
        }
    }
} import java.util.Scanner; Scanner java.util class Main { 
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        int count = 0;
        int borderline = 1000;
        
        boolean primes[] = new boolean [borderline];
        for(int n = 2; n < primes.length; n++){
            if(primes[n]) continue;
            for(int m = 2 * n; m < primes.length; m += n) {
                primes[m] = true;
            }
        }
        
        while (N != 0) {
            int num = in.nextInt();
            if       ((num >  borderline) && isPrime(num)) count++;
            else  if ((num <= borderline) && !primes[num]) count++;
            N--;
        }
        
        System.out.println(count);
    }
    
    public static boolean isPrime(int x) {
        if      (x == 2)     return true;
        else if (x % 2 == 0) return false;
        else {
            for (int i = 3; i * i <= x; i += 2) {
                if (x % i == 0) return false;
            }
            return true;
        }
    }
} Main public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        int count = 0;
        int borderline = 1000;
        
        boolean primes[] = new boolean [borderline];
        for(int n = 2; n < primes.length; n++){
            if(primes[n]) continue;
            for(int m = 2 * n; m < primes.length; m += n) {
                primes[m] = true;
            }
        }
        
        while (N != 0) {
            int num = in.nextInt();
            if       ((num >  borderline) && isPrime(num)) count++;
            else  if ((num <= borderline) && !primes[num]) count++;
            N--;
        }
        
        System.out.println(count);
    } main {
        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        int count = 0;
        int borderline = 1000;
        
        boolean primes[] = new boolean [borderline];
        for(int n = 2; n < primes.length; n++){
            if(primes[n]) continue;
            for(int m = 2 * n; m < primes.length; m += n) {
                primes[m] = true;
            }
        }
        
        while (N != 0) {
            int num = in.nextInt();
            if       ((num >  borderline) && isPrime(num)) count++;
            else  if ((num <= borderline) && !primes[num]) count++;
            N--;
        }
        
        System.out.println(count);
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) int N = in.nextInt(); N in.nextInt() in.nextInt in int count = 0; count 0 int borderline = 1000; borderline 1000 boolean primes[] = new boolean [borderline]; primes new boolean [borderline] borderline for(int n = 2; n < primes.length; n++){
            if(primes[n]) continue;
            for(int m = 2 * n; m < primes.length; m += n) {
                primes[m] = true;
            }
        } int n = 2; int n = 2; n 2 n < primes.length n primes.length primes primes.length n++ n++ n {
            if(primes[n]) continue;
            for(int m = 2 * n; m < primes.length; m += n) {
                primes[m] = true;
            }
        } {
            if(primes[n]) continue;
            for(int m = 2 * n; m < primes.length; m += n) {
                primes[m] = true;
            }
        } if(primes[n]) continue; primes[n] primes n continue; for(int m = 2 * n; m < primes.length; m += n) {
                primes[m] = true;
            } int m = 2 * n; int m = 2 * n; m 2 * n 2 n m < primes.length m primes.length primes primes.length m += n m += n m n {
                primes[m] = true;
            } {
                primes[m] = true;
            } primes[m] = true primes[m] primes m true while (N != 0) {
            int num = in.nextInt();
            if       ((num >  borderline) && isPrime(num)) count++;
            else  if ((num <= borderline) && !primes[num]) count++;
            N--;
        } N != 0 N 0 {
            int num = in.nextInt();
            if       ((num >  borderline) && isPrime(num)) count++;
            else  if ((num <= borderline) && !primes[num]) count++;
            N--;
        } int num = in.nextInt(); num in.nextInt() in.nextInt in if       ((num >  borderline) && isPrime(num)) count++;
            else  if ((num <= borderline) && !primes[num]) count++; (num >  borderline) && isPrime(num) (num >  borderline) num borderline isPrime(num) isPrime num count++ count if ((num <= borderline) && !primes[num]) count++; (num <= borderline) && !primes[num] (num <= borderline) num borderline !primes[num] primes[num] primes num count++ count N-- N System.out.println(count) System.out.println System.out System System.out count String[] args args public static boolean isPrime(int x) {
        if      (x == 2)     return true;
        else if (x % 2 == 0) return false;
        else {
            for (int i = 3; i * i <= x; i += 2) {
                if (x % i == 0) return false;
            }
            return true;
        }
    } isPrime {
        if      (x == 2)     return true;
        else if (x % 2 == 0) return false;
        else {
            for (int i = 3; i * i <= x; i += 2) {
                if (x % i == 0) return false;
            }
            return true;
        }
    } if      (x == 2)     return true;
        else if (x % 2 == 0) return false;
        else {
            for (int i = 3; i * i <= x; i += 2) {
                if (x % i == 0) return false;
            }
            return true;
        } x == 2 x 2 return true; true if (x % 2 == 0) return false;
        else {
            for (int i = 3; i * i <= x; i += 2) {
                if (x % i == 0) return false;
            }
            return true;
        } x % 2 == 0 x % 2 x 2 0 return false; false {
            for (int i = 3; i * i <= x; i += 2) {
                if (x % i == 0) return false;
            }
            return true;
        } for (int i = 3; i * i <= x; i += 2) {
                if (x % i == 0) return false;
            } int i = 3; int i = 3; i 3 i * i <= x i * i i i x i += 2 i += 2 i 2 {
                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; false return true; true int x x
import java.util.Scanner;

class Main { 
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        int count = 0;
        int borderline = 1000;
        
        boolean primes[] = new boolean [borderline];
        for(int n = 2; n < primes.length; n++){
            if(primes[n]) continue;
            for(int m = 2 * n; m < primes.length; m += n) {
                primes[m] = true;
            }
        }
        
        while (N != 0) {
            int num = in.nextInt();
            if       ((num >  borderline) && isPrime(num)) count++;
            else  if ((num <= borderline) && !primes[num]) count++;
            N--;
        }
        
        System.out.println(count);
    }
    
    public static boolean isPrime(int x) {
        if      (x == 2)     return true;
        else if (x % 2 == 0) return false;
        else {
            for (int i = 3; i * i <= x; i += 2) {
                if (x % i == 0) return false;
            }
            return true;
        }
    }
}