#include<stdio.h>
#include<math.h>
int hantei(int);
main(){
  int i,j,n,s,sum=0;
  int N[10000];
  scanf("%d",&n);
  for(i=0;i<n;i++) scanf("%d",&N[i]);
  for(i=0;i<n;i++)if(hantei(N[i]))sum++;  
  printf("%d\n",sum);
  return 0;
}

int hantei(int n){
  int i=3;
  if(n==2)return 1;
  if(n<2 || (n%2)==0)return 0;
  while(i<=sqrt(n)){
    if((n%i)==0)return 0;
    i+2}
  else return 0;
}