int hantei (int target){
  int i;
  if(target<2) return 0;
  else if(target == 2) return 1;
  else if(target % 2 ==0) return 0;

  for(i=3; i*i <= target; i+=2){
    if(target % i ==0) return 0;
  }
}

int main(){
  int i,j, yaku,n,target;

  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&target);
    if(hantei(target) == 1) yaku++;
  }

  printf("%d",yaku);

  
}

