
#include<stdio.h>


int isprime(int *,int);

#define N 10000

main(){
  int i,count,num[N];
  scanf("%d",&count);
  for(i=0;i<count;i++){
    scanf("%d",&num[i]);#include<stdio.h>


int isprime(int *,int);

#define N 10000

main(){
  int i,count,num[N];
  scanf("%d",&count);
  for(i=0;i<count;i++){
    scanf("%d",&num[i]);
  }
  printf("%d\n",insprime(num,count));
  return 0;
}


int insprime(int *x,int count){
    int i,j,y,a=0;
    for(i=0;i<count;i++){
      y=0;
      for(j = 1; j <= x[i] ;j++){
	if(x[i]%j==0) y++;
      }
      if(y==2) a = a+1;
    } 
    return a;  
  }

  }
  printf("%d\n",insprime(num,count));
  return 0;
}


int insprime(int *x,int count){
    int i,j,y,a=0;
    for(i=0;i<count;i++){
      y=0;
      for(j = 1; j <= x[i] ;j++){
	if(x[i]%j==0) y++;
      }
      if(y==2) a = a+1;
    } 
    return a;  
  }