#include<stdio.h>
#include<math.h>

int main(){
  int i,j=3,n,x[100],count=0;

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

  for(i = 0;i < n;i++){
    if(x[i] == 2){
      count++;
      continue;
    }
    else if(x[i] < 2 || x[i] % 2 == 0){
      continue;
    }
    else{
      while(sqrt(x[i]) <= s){
	if(x[i] % j == 0){
	  continue;
	}
	j = j + 2;
      }
      count++;
      continue;
    }
  }

  printf("%d\n",count);

  return 0;
}