#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)count++;
    else if(A[i]%2==1){
      for(j=3;j<sqrt(A[i]);j=j+2){
	if((A[i]%j)==0)uncount++;
      }
    }
  }

  count = n - uncount + count;

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

  return 0;
}