int main() {
	int n, a, b, c, p;
	int Z[10000];
	c = 0;

	scanf("%d", &n);

	for (a = 0;a < n;a++) scanf("%d", &Z[a]);

	for (a = 0;a < n;a++) {
		b = 1;
		for (p = 2;p <= (Z[a] / 2) && b != 0;p++) {
			b = Z[a] % p;
			if (b == 0) c++;
		}
	}

	printf("%d\n", n - c);

	return 0;
}