#include<stdio.h>

int main()
{
	int i,j,n,s, d;
	int a[10000];
	
	scanf("%d", &n);
	s = n;
	for (i = 0; i < n; i++) {
		scanf("%d", &a[i]);
	}
	for (i = 0; i < n; i++)
	{
		for (j = 2; j < a[i]; j++) {
			if (a[i] % j == 0 || a[i]%2+==0) {
				s = s - 1;
				break;
			}
		}
	}
	printf("%d\n", s);
}