#include <stdlib.h>
#include <math.h>
#include <stdio.h>
 
int main(){
int i,j,n,x,y,z,a[];
scanf("%d",&n);
for(i=0;i<n;i++){
int a[i];
scanf("%d",a[i]);
printf("\n");
}
x = y =0;
for(i=0;i<n;i++){
    for(j=2;j<a[i];j++){
        if(a[i]%j != 0){
           x = 1;
          }
        }
     y += x;
   }
printf("%d\n",y);
return 0;
}
 