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

static const int N = 10000;
int isprime(int);

int main(){
  
  int count=0,n,A[N],i,c1,c2;
  
  scanf("%d",&n);
  for ( i = 0; i < n; i++ ) scanf("%d", &A[i]);
  for(i=0;i<n;i++){
    if(isprim(A[i])==0){
      count++;
    }
  }
  printf("\n%d\n",count);
  
  int isprime(int A){
    if(A == 2){ 
      return 0;
    }
    c1=A%2;
    if(A < 2 || c1==0){
      return 1;
    }
    i = 3;
    while(i <=(int)sqrt(A)){
      c2=A%i;
      if(c2==0)
	return 1;
      i = i + 2;
      return 0;
    }
  }
  
  return 0;
}