#include<iostream>
#include<algorithm>
#include<math.h>
using namespace std;
int main()
{
int n,x,sum1=0;
cin>>n;
for(int i=0;i<n;i++)
{
	cin>>x;
	int sum=0;
	for(double j=2;j<=(int) (sqrt(x+0.5));j++)
	{
		if(x%(int)j!=0)
		sum++;
	}
	if(sum==(int)(sqrt(x+0.5))-1)
	sum1++;
}
   cout<<sum1<<endl;
}
