
#include <stdio.h>
int main(){
  int i,j,n,x=0;
  int sosu[10000];
  int count=0;
  
  scanf("%d",&n);
  
  for(i=0;i<n;i++){
    scanf("%d",&sosu[i]);
    if (sosu[i]!=2 && (sosu[i]%2)==0) {
    }
    else{
      sosu[x]=sosu[i];
      x++;
    }
  }


  
  // printf("%d\n",x);
  
  
  for(i=0;i<x;i++){
    if(sosu[i]==1) continue;
    int flag = 0;
    for(j=2;j<sosu[i];j++){
      if((sosu[i]%j)==0){
        flag = 1
        break;
      }
    }
    if(flag==0)count++;
  }

  printf("%d\n",count);
  
  return 0;
}