#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <time.h>

#define NOCHK 0
#define PRIME 1
#define NOTPRIME 2

static clock_t start_time,end_time;
void clock_start(){
	start_time = clock();
}
void clock_end(char *msg){
	end_time = clock();
	printf("[%s]%ld\n",msg,(end_time-start_time));
}

int main(int argc, char** argv){
	int n,data,*data_list;
	int count;
	int max_data;
	int i,j;
	char *prime_map;

	// Input n
	scanf("%d",&n);
	data_list = malloc(sizeof(int)*n);
	max_data = 0;
	for(i=0;i<n;i++){
		scanf("%d",&data);
		if( data > max_data ){
			max_data = data;
		}
		data_list[i] = data;
	}
	
	// Create Prime Map
	clock_start();
	prime_map = malloc(sizeof(char)*(max_data+1));
	memset(prime_map,NOCHK,sizeof(char)*(max_data+1));
	for(i=2;i<=max_data;i++){
		if( prime_map[i] == NOCHK ){
			prime_map[i] = PRIME;
			for(j=i*2;j<=max_data;j+=i){
				prime_map[j] = NOTPRIME;
			}
		}
	}
	clock_end("Create Prime Map");

	// Check Prime Count
	clock_start();
	count = 0;
	for(i=0;i<n;i++){
		if( prime_map[data_list[i]] == PRIME ){
			count++;
		}
	}
	clock_end("Check Prime Count");

	// Output
	printf("%d\n",count);

	return 0;
}