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

int main()
{
	int i, j, n, s;
	double q,x;
	int a[10000];

	scanf("%d", &n);
	s = n;
	for (i = 0; i < n; i++) {
		scanf("%d", &a[i]);
	}
	for (i = 0; i < n; i++) {
                j=0;
		q=sqrt(a[i]);
                x=ceil(q)
		while (j < x) {
			if (a[i] % j == 0 || a[i] % 2 == 0) {
				s--;
				break;
			}
			else {
				j++;
			}
		}
	}
	printf("%d\n", s);
}