#include<iostream>
using namespace std;
bool data[100000000] = { "true" };
void solve() {
	data[0] = "false";
	for (int i = 2; i <= 100000000; ++i) {
		if (data[i - 1]) {
			for (int j = 2; i*j <= 100000000; ++j)
				data[i*j - 1] = "false";
		}
	}
}
int main() {
	int n,x,cnt=0;
	solve();
	cin >> n;
	for (int i = 0; i < n; ++i) {
		cin >> x;
		if (data[x - 1]) ++cnt;
	}
	cout << cnt;
}
