#include <iostream>
#include <cmath>
using namespace std;

bool f(int x){
	if(x == 1) return false;
	bool res = true;
	for(int i = 2; i <= sqrt(x); ++i){
		if(x % i == 0){
			res = false;
			break;
		}
	}
	return res;
}
int main () {
	
	int n, x, k = 0;
	cin >> n;
	
    while (cin>>x){	
		if (f(x) == true) 
		k++;
		
	}
	cout<<k;
	a
	return 0;
}