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

int main(void){
	int n,ans=0;
	cin>>n;
	for(int i=0;i<n;i++){
	    int a,check=1;cin>>a;
	    for(int j=2;j*j<=a;j++){
	        if(a%j==0){
	            check=0;break;
	        }
	    }
	    if(check)ans++;
	}
	cout<<ans<<endl;
	return 0;
}
