#include<bits/stdc++.h>
#define ll long long

using namespace std;

int main(){
	ll n,x,p,z,i,j;
	
	cin>>n;
	
	z=0;
	for(i=1;i<=n;i++){
		p=0;
		cin>>x;
		if(x>2 && x%2==0) p=1;
		for(j=3;j*j<=x;j+=2){
			if(x%j==0) p=1,j=x;
		}
		if(p==0) z++;
	}
	
	cout<<z<<endl;
}
