#include <bits/stdc++.h>
using namespace std;

int main(void){
	int n;
	int ans = 0;

	cin >> n;

	for(int i=0; i<n; i++){
		int x;
		cin >> x;

		if(x == 2) ans++;
		if(x%2 == 0) continue;
		int j=3;
		for(; j<=sqrt(x); j+=2){
			if(x % j == 0) break;
		}
		if(j > sqrt(x)) {
			ans++;
		}
	}

	printf("%d\n", ans);

	return 0;
}