#include <stdio.h>

int main(){
	int n, c, x;
	scanf("%d", &n);

	c = 0;
	for (int i=0; i<n;i++) {
		scanf("%d", &x);
		for (int j=2; j*j<=x; j++) {
			if ((x%j)==0) {
				goto skip;
			}
		}

		c++;
skip: 0;
	}

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


