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

int main(void)
{
  int n, x;
  int i,j;
  int k = 0;
  int l = 0;
  int a[10000];

  scanf(???%d???, &n);

  for(i = 0; i < n; i++) {
    scanf(???%d???, &a[i]);
  }

  for(i = 0; i < n; i++) {
    if(a[i] % 2 == 0)
       a[i] = 0;
  }

  for(i = 0; i < n; i++) {
    for(j = 3; j < sqrt(a[i]); j += 2) {
      if(a[i] % j == 0)
        break;
      l = 1;
    }
    if(l == 1) {
      k = k + 1;
      l = 0;
    }
  }

  printf(???%d?\n???, k);

  return 0;
}