#include <stdio.h>
#include <cmath>

int main(){
	int n, element, count = 0, limit;
	scanf("%d",&n);

	for(int i = 0; i < n; i++){
		scanf("%d", &element);
		limit = sqrt(element);
		for(int j = 2; j <= limit; j++){
			if(element % j == 0){
				count++;
				break;
			}
		}
	}
	printf("%d\n",n - count);
}

