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

int isPrime(int);

int main()
{
  int n, *data, k = 0, i, key;

  /*??\??????????????°????±????*/
  scanf("%d", &n);

  data = (int *)malloc(n * sizeof(int));

  for(i = 0; i < n; i++)
    scanf("%d", &data[i]);

  for(i = 0; i < n; i++){
    key = isPrime(data[i]);
    if(key == 1)
      k++;
  }
  printf("%d\n", k);
  free(data);
  return 0;
}