#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <stack>
#include <queue>
#include <list>
#include <cstdlib>
#define _USE_MATH_DEFINES

using namespace std;

bool isPrime(int n) {

	int i = 3;

	if (n == 2)
		return true;
	if (n <= 1 || n %2 == 0)
		return false;

	while (i <= sqrt(n)) {
		if (n % i == 0) 
			return false;
		i = i + 2;
	}
	return true;
}

int main() {

	int n, cnt=0,x;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> x;
		if (isPrime(x))
			cnt++;
	}
	
	cout << cnt << endl;
	
	return 0;
}