#include<stdio.h>

int prime(int);

int main()
{
   int n, i, x;
   int ans = 0;

   scanf ("%d", &n);

   for (i=0; i<n; i++){
      scanf ("%d", &x);
      if (prime(x))
         ans++;
   }

   printf ("%d", ans);

   return 0;
}


int prime(int x)
{
   int i = 3;   /*1????????§??????????°?????\???°*/

   if (x==2)
      return 1;   /*return 1??§2????´???°*/

   if(x<2 || x%2==0)
      return 0;   /*return 0??§x????´???°??§?????????*/

   while (i*i<=x){
      if (x%i==0){
         return 0;   /*i*i=x?????¨???x%i==0??§x????´???°??§?????????*/
      i = i+2;   /*i=3???+=2????????????????\???°????¶????*/
   }

   return 1;
}