#include "stdio.h"


void main(int argc, _TCHAR* argv[])
{
	int N = 0;
	//printf("INPUT: ");
	scanf_s("%d", &N);
	int prime_n = 0;
	for (int i = 0; i < N; i++){
		int n = 0;
		scanf_s("%d", &n);
		int isPrime = 1;
//		printf("%d  ", n);
		for (int j = 2; j < n/j; j++){
//			printf("%d", j);
			if (n%j == 0){
				isPrime = 0;
				break;
			}
		}
		if (isPrime){ prime_n++; }
	}
	//printf("result");
	printf("%d", prime_n);

	//getchar();
	//getchar();

}