#include <stdio.h>
#include <math.h>

int N;
int A[10000];
int NN = 0;

void insertion(int a[]);
int print(int d[], int c);

int main(){

	int i = 0;
	int ab, cd; 

	scanf("%d", &N);
	for (i = 0; i < N; i++){
		scanf_s("%d",&A[i]);
	}
	//printf("%d %d", ab,cd);


	insertion(A);
	printf("%d", NN);

	return 0;

}

void insertion(int a[]){
	int v;
	int i;
	int j;
	int y = 0;

	//printf("OK");

	for (i = 0; i < N; i++){
	A:;
		if (a[i] == 2) printf("%d\n", a[i]);

		if (a[i] % 2 != 0){
			for (j = 2; j <= a[i] - 1; j++){
				if (a[i] % j == 0) goto A;
				if (j == a[i] - 1){
					NN++;
				}
			}
		}
	}
}