
int main(){

  int i,x,n,count = 0;
  int *m;

  scanf("%d",&n);
  m = malloc(sizeof(int) * n);
  for(i = 0 ; i < n ; i++)
    {
      scanf("%d",&m[i]);
      if( isprime(m[i]) == 1)
        {
          count++;
        }
    }
  printf("%d\n",count);
  free(m);
  return 0;
}

int isprime(x){

if( x == 2) return 1;
if( x  < 2 || x % 2 == 0) return 0;
while ( i <= sqrt(x) )
    {
      if(x % i == 0) return 0;
      i = i +2;
    }

return 1;
}