#include<stdio.h>


int main(void){

  int N;
  int i;
  int ans=0;
  
  
  scanf("%d",&N);
    int array[N];
 

    
  for(i=0;i<N;i++){
    scanf("%d",&array[i]);
  }
  
  ans=judge(array,N);
  printf("%d",ans);
  
  return 0;  
}

int judge(int a[],int N){
  int count=0;
  int count1=0;
  int i;
  int j;



  for(i=0;i<N;i++){
    count=0;

    for(j=2;j<a[i];j++){
      
      
      if(a[i]%j==0){
	count=count+1;
	break;
    }

   }

    if(count==0){count1++;}
  }

  return count1;  
}

