//16D8101002H Iori Anzai 螳芽･ｿ 莨顔ｹ・險隱・C

#include<stdio.h>
#include<math.h>
#define N 1000

int main(void)
{
  for(i=0;i<n;i++){
    scanf("%d",&x[i]);
  }
  

  int n;
  scanf("%d",&n);

  int x[N];
  int cnt[N]={};
  int i;
  int cntp=0;
  double rtx[n];

  for(i=0;i<n;i++)
    rtx[i]=sqrt(x[i]);

  int j;
  for(i=0;i<n;i++){
    if(x[i]%2==1){
      for(j=2;j<=rtx[i]+1;j+=1){
	if(x[i]%j==0){
	  cnt[i]++;
	}
      }
    }
    else{
      cnt[i]++;
    }
  }

  for(i=0;i<n;i++){
    if(x[i]!=1&&cnt[i]==0) cntp++;
  }
  for(i=0;i<n;i++){
    if(x[i]==2) cntp++;
  }
  printf("%d",cntp);
  return 0;
}

