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;
        
        boolean primes[] = new boolean [100000000];
        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 (!primes[num]) count++;
            N--;
        }
        
        System.out.println(count);
    }
}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz