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

int main(){
	int n, count=0;
	cin >> n;
	while(n--){
		bool prime = true;
		int k, endk;
		cin >> k;
		endk = (int)sqrt(k);
		for( int i=2; i<=endk; i++ ){
			if( k%i == 0 ){
				prime = false;
				break;
			}
		}
		if( prime )	count++;
	}
	cout << count << endl;
	return 0;
}