#include<stdio.h>
#include<cmath>
#include<algorithm>

int main() {
	int n, temp, count=0, p;
	scanf("%d", &n);
	for(int i=0; i<n; i++) {
		scanf("%d", &temp);
		p = sqrt(temp);
		for(int j=2; j<=p; j++) {
			if (temp%j == 0) {
				count++;
				break;
			}
		}
	}
	printf("%d\n", n-count);
	return 0;
}
