#include<iostream>
using namespace std;
unsigned int x, y;
int pisprime(int x)
{
	int n;

	if (x == 2) return 1;
	if (x < 2 || x % 2 == 0) return 0;
	for (n = 3; n <= sqrt((double)x); n += 2)
		if (x % n == 0) return 0;
	return 1;
}
int main() {
	int temp=0, a, n,flag=0;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a;
		for (int i = 2; i < a; i++) {
			if (a%i == 0) {
				flag = 1;
				break;
			}
		}
		if (flag == 0)temp++;
		flag = 0;
	}
	cout << temp << endl;
}