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


int Judge(int i){
	int flag=1;
	for(int j=2;j<=sqrt(i);j++){
		if(i%j==0){
			flag=0;
		}
	}
	return flag;

}

int main() {	

	
	int n,a;
	int count=0;
	cin>>n;
	
	for(int i=0;i<n;i++){
		cin>>a;
		if(Judge(a)){
			count++;
		}
	}
	cout<<count<<endl;
	return 0;
}