#include <bits/stdc++.h>
int main(void) {
  register long i, j;
  long n, d, c, end1, end2;
  char *num;
  num = (char *)calloc((100000000), sizeof(char));
  end1 = (long)sqrt((double)(100000000));
  for (i = 2; i < end1; i++) {
    if (!num[i]) {
      end2 = (100000000) / i;
      for (j = 2; j < end2; j++) {
        num[i * j] = 1;
      }
    }
  }
  scanf("%ld", &n);
  c = 0;
  while (n-- > 0L) {
    scanf("%ld", &d);
    if (!num[d]) {
      c++;
    }
  }
  printf("%d\n", c);
  free(num);
  return 0;
}
