#include <stdio.h>

int main(void)

{
 int n, i, j;
 int a[10000];
 int k = 0;
 int count = 0;
 
 scanf("%d", &n);

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

 if(a[i] % 2 != 0 || a[i] == 2) 
{

  for(j = 2; j < sqrt(a[i]); j++)
{
  if(a[i] % j == 0)
{
   k = 1;
   break;
}

}

  if(k == 0)
   count++;

 k = 0;

}

}

 printf("%d\n", count);

return 0;

}

