#include <stdio.h>
#include <math.h>
int main(void)
{
	int n, x, i, j, count, ans = 0;
	scanf_s("%d", &n);
	if (n >= 1 && n <= 10000) {
		for (i = 0; i < n; i++) {
			scanf_s("%d", &x);
			if (x >= 2 && x <= (pow(10.0, 8.0))) {
				count = 0;
				for (j = 1; j <= x; j++) {
					if (x % j == 0) count++;
					if (count > 2) break;
				}
				if (count == 2) ans++;
			}
		}
	}
	printf("%d\n", ans);
	return 0;
}
