#include <stdio.h>

#define REP(i,n) for(int i = 0; i < (n); i++)
#define RREP(i,n) for(int i = (n) - 1; i >= 0; i--)
#define FOR(i,a,b) for(int i = (a); i < (b); i++)
#define RFOR(i,b,a) for(int i = (b) - 1; i >= (a); i--)
#define STRS(i,str) for(int i = 0; (str)[i]; i++)

int main(){
	int n, a;
	int count = 0;
	scanf("%d", &n);
	REP(i, n){
		scanf("%d", &a);
		int b = 0, c = a;
		for(;;){
			if(b == c) break;
			else if((b + c + 1)/2 > a/((b + c + 1)/2)) c = (b + c - 1)/2;
			else b = (b + c + 1)/2;
		}
		FOR(j, 2, b) if(a % j == 0) goto tggx;
		count++;
tggx:
	}
	printf("%d\n", count);
}