#include <iostream>
using namespace std;


bool primeNum(int num) {
	if (num < 2) return false;
	else if (num == 2) return true;
	else if (num % 2 == 0) return false;

	for (int i = 3; i <= sqrt(num); i += 2) {
		if (num%i == 0)
			return false;
	}

}

int main(void) {

	int n;
	int count = 0;
	cin >> n;
	for (int i = 0; i < n; i++) {
		int a;
		cin >> a;
		if (primeNum(a)) count++;
	}
	cout << count;

	return 0;
}
