#include <algorithm>
#include <climits>
#include <iostream>
#include <string>
#include<cstdio>
#include <vector>
#include<queue>
#include<limits.h>
#include<string.h>
#include<functional>
#include<map>
#include<set>
#include<list>
using namespace std;

signed main() {
	int a; cin >> a;
	int sum = 0;
	for (int i = 0; i < a; i++) {
		int b : cin >> b;
		for (int c = 2; c*c <= b; c++) {
			if (b%c == 0) { sum--; break; }
		}
		sum++;
	}
	cout << sum << endl;
}