#include<stdio.h>
#include<math.h>
//#define N 10000

int main(){
  int x=0,n;
  //int A[N];
  int i,j;

  int bool=0,check=0;

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

  for(i=0;i<n;i++){
    if(A[i]==2) {
      x++;
      continue;
    }
    else if(A[i]%2==0) continue;
    else if(A[i]==sqrt(A[i])*sqrt(A[i])) continue;
    for(j=3;j<A[i];++j){
      if(A[i]%j==0){
	       bool = 1;
	       break;
      }
    }
    if(bool==0) x++;
    bool = 0;
  }

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

  return 0;
}

