#include <stdio.h>
#define N 10000

int isPrime(int x){
	int i;
	if(x < 2)  
	return 0;
	if(x == 2) 
	return 1;
	if(x % 2 == 0)
	return 0;
	
	for(i = 3; i * i =< x; i = i + 2)
	if(x % i == 0)
	return 0;
	
	return 1;
	
}

int main(void) {
	int count, i , n;
	count = 0;
	scanf("%d" ,&n);
	int a[N];
	
	for(i = 0;i < n;i++){
		scanf("%d" , &a[i]);
		count = count + isPrime(a[i]);
	}
	
	printf("%d\n" , count);
	
	return 0;
}
	
