#include <stdio.h>

int main()
{
	int n, a[10000];
	int i, j, k, count;
	
	scanf("%d", &n);
	
	for(i = 0; i < n; i++)
		scanf("%d", &a[i]);
	
	count = 0;
	
	for(i = 0; i < n; i++){
		if(a[i] == 2){
			count++;
		}else if(a[i]%2 != 0 && a[i] > 2){
			k = sqrt(a[i]);
			j = 3;
			while(j <= k){
				if(a[i]%j == 0)
				break;
				
				j += 2;
			}
		}
	}
	
	printf("%d\n", count);
	
	return 0;
}