#include <bits/stdc++.h>
void sieve(char *list, long max) {
  int i, j;
  list[0] = 1;
  list[1] = 1;
  for (i = 2; i <= (int)sqrt(max); i++) {
    if (list[i] == 0) {
      for (j = 2; i * (long)j <= max; j++) {
        list[i * j] = 1;
      }
    }
  }
}
int prime_check(long n, char *list, long l) {
  long i;
  int t;
  t = 0;
  for (i = 2; i <= l && i < n; i++) {
    if (list[i] == 0 && n % i == 0) {
      t = 1;
      break;
    }
  }
  if (n == 0 || n == 1) t = 1;
  return t;
}
int main() {
  int N, i, t;
  scanf("%d", &N);
  long a[N], max;
  max = 0;
  for (i = 0; i < N; i++) {
    scanf("%ld", a + i);
    if (a[i] > max) max = a[i];
  }
  char *prime_list;
  prime_list = (char *)malloc(sizeof(char) * (max / 2 + 1));
  memset(prime_list, 0, max / 2 + 1);
  sieve(prime_list, max / 2);
  t = 0;
  for (i = 0; i < N; i++) {
    if (prime_check(a[i], prime_list, max / 2) == 0) t++;
  }
  printf("%d\n", t);
  free(prime_list);
  return 0;
}
