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

typedef struct PrimeInfo {
	int progress;
	int *list;
	int list_size;
	int prime_count;
} PrimeInfo;

void update_prime_info(PrimeInfo *p_info, int new_value){
	int i;
	int found;
	int *new_list;

	if( new_value >= 2 ){
		while(p_info->progress < new_value){
			p_info->progress++;
			// Check Divide Possiblity
			found = 0;
			for(i=0;i<p_info->prime_count;i++){
				if( (p_info->progress % p_info->list[i]) == 0 ){
					found = 1;
					break;
				}
			}
			if(!found){
				p_info->prime_count++;
				if( p_info->prime_count > p_info->list_size ){
					new_list = malloc( p_info->list_size * 2 * sizeof(int));
					memcpy( new_list, p_info->list, p_info->list_size  * sizeof(int) );
					free(p_info->list);
					p_info->list = new_list;
					p_info->list_size = p_info->list_size * 2;
				}
				p_info->list[p_info->prime_count-1] = p_info->progress;
			}
		}
	}
}

int int_asc(const void *p1, const void *p2){
	return (*(int*)p1) - (*(int*)p2);
}

int is_prime(PrimeInfo *p_info, int new_value){
	if(bsearch(&new_value,p_info->list,p_info->progress,sizeof(int),int_asc) != NULL ){
		return 1;
	} else {
		return 0;
	}
}

int main(int argc, char** argv){
	int n,value;
	PrimeInfo info;
	int count;

	// Init Prime Info
	info.progress = 1;
	info.list = malloc(10 * sizeof(int));
	info.list_size = 10;
	info.prime_count = 0;
	// Init Count
	count = 0;

	// Input n
	scanf("%d",&n);
	while(n-- > 0){
		// Input Value
		scanf("%d",&value);
		// Update Pfine Info
		update_prime_info(&info,value);
		// Check Prine Info
		if( is_prime(&info,value) ){
			count++;
		}
	}

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

	return 0;
}