#include<stdio.h>
#include<math.h>

int main()
{
int n,x,i,m[10000];
int con;

  scanf("%d",&n);
for(i=0;i<n;i++)  {
  scanf("%d",&m[i]);

if(func(m[i]) == 1)
 con++;
}
printf("%d\n",con);
return 0;
}

 int fanc(int m[])
{
int j=3;

if(m[]==2 || m[]==3)
return 1;

if(m[]<2 || m[]%2==0)
return 2;

while(j*j<=squrt(m[])){
if(m[]%j==0)
 break;

j+=2;
}

if(m[]%j != 0)
return  1;
}