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