#include <bits/stdc++.h>
int main(void) {
  int n, i, j, seisu[10000], co = 0, max = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &seisu[i]);
    if (((seisu[i] != 2) && (seisu[i] % 2 == 0)) ||
        ((seisu[i] != 5) && (seisu[i] % 5 == 0)))
      seisu[i] = 0;
    if (max < seisu[i]) max = seisu[i];
  }
  for (i = 3; i <= max; i += 2) {
    for (j = 0; j < n; j++) {
      if ((seisu[j] != 0) && (seisu[j] <= i)) seisu[j] = 1;
      if ((seisu[j] != 1) && (seisu[j] % i == 0)) seisu[j] = 0;
    }
  }
  for (i = 0; i < n; i++) {
    if (seisu[i] == 1) co++;
  }
  printf("%d\n", co);
  return 0;
}
