#include<iostream>
using namespace std;
unsigned int x, y;
int pisprime(int x)
{
	int n;

	if (x == 2) return 1;
	if (x < 2 || x % 2 == 0) return 0;
	for (n = 3; n <= sqrt((double)x); n += 2)
		if (x % n == 0) return 0;
	return 1;
}
int main() {
	int temp=0, a, n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a;
		if (pisprime(a) ==1) {
			temp++;
		}
	}
	cout << temp << endl;
}