#include<iostream>
using namespace std;
bool heheda(int a);

bool heheda(int a) {
	for (int i = 2; i*i <= a; i++) 
		if (!(a % i)) return false;
	return true;
}

int main() {
	int n;
	cin >> n;
	int tmp2 = 0;
	int c;
	for (int i = 0; i < n; i++) {
		cin>>c;
		if (heheda(c))
			tmp2 += 1;
	}
	cout<< tmp2 <<endl;
	return 0;
}
