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

int main(){

  int n,j,i,uncount=0,x,count=0;
  int *A;

  scanf("%d",&n);

  A = malloc(sizeof(int)*n);

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

  for(i=0;i<n;i++){
    if(A[i]==2||A[i]==3);
    else if(A[i]%2==0)uncount++;
    else for(j=3;j<sqrt(A[i]);j=j+2){
	if((A[i]%j)==0){
	  uncount++;
	  break;
	}
      }
  }


  count = n - uncount + count;

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

  free(A);
  return 0;
}