#include <iostream>
using namespace std;

bool IsPrime(int n){
	for(int i=2;i*i<=n;i++){
		if(n%i == 0){return false;}
	}
	return true;
}

int main(void) {
	int count =0;
	int n;
	cin >> n;
	for(int i=0;i<n;i++){
		int p;
		cin >> p;
		if(IsPrime(p)){
			count++;
		}
	}
	cout << count << endl;
	return 0;
}
