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

int main(){
  
  int n, i, j;
  int a[N];
  int count = 0;

  scanf("%d",&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 == 0){
   
      for(j = 3; j <= sqrt( ; j += 2){

	  if(a[i] % j == 0){
	    count++;
	    break;
	  }

	}

    }

  }

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

  return 0;
}