#include <stdio.h>

int main(void) {
	int a[10000],i,j,b,k,n,c;
	
	c = 0;
	
	scanf("%d\n",&n);
	
	for(i=0;i<n;i++){
		scanf("%d\n",&a[i]);
		b = a[i];
		for(j=3;j<b;j+=2){
			for(k=3;k<=sqrt(j);j+=2){
				if(b%k == 0){
					c++;
					break;
				}
			}
		}
	}	
	printf("%d\n",n-c);
	
	return 0;
}
