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

int main() {
	int N, ans = 0;
	cin >> N;
	for (int i = 0; i < N; i++) {
		bool check = true;
		int A;
		cin >> A;
		for (int i = 2; i <= sqrt(A); i++) {
			if (A % i == 0) check = false;
		}
		ans += check;
	}
	cout << ans << endl;
}
