#include <bits/stdc++.h>
#define PI 3.14159265359
using namespace std;

int main() {
	int n;
	cin >> n;

	int c = 0;
	for (int i = 0; i < n; i++) {
		int a;
		cin >> a;

		int b = sqrt(a);
		bool bl = true;
		for (int j = b; j > 1; j--) {
			if (a % j == 0) {
				bl = false;
			}
		}

		if (bl) c++;
	}

	cout << c << endl;
}
