#include <stdio.h>

int main() {
	int n = 0, a[10000], i, j, count = 0, flag = 0;
	scanf_s("%d", &n);
	for (i = 0; i < n; i++) {
		scanf_s("%d",&a[i]);
	}

	for (i = 0; i < n; i++) {
		if (a[i]==2) {
			count++;
		}
		else {
			for (j = 2; j < a[i]; j++) {
				if (a[i]%j==0) {
					flag = 1;
					break;
				}
			}
			if (flag==0) {
				count++;
			}
		}
		flag = 0;
	}

	printf("%d\n", count);
	return 0;
}
