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

int main(){
	int n,a,cnt = 0,f;
	cin >> n;
	for(int i = 0;i < n;++i){
		f = 1;
		cin >> a;
		for(int j = 2;j <= sqrt(a);++j){
			if(!(a % j)) {
				f = 0;
				break;
			}
		}
		if(f || a == 2) ++cnt;
	}
	cout << cnt << endl;
	return 0;
}