#include <bits/stdc++.h>
int isprime(int a[], int target, int n) {
  if (a[target] == 1) return 1;
  if (a[target] == 0) return 0;
  for (int i = 2; i * i <= target; i++) {
    if (target % i == 0) {
      a[target] = 0;
      return 0;
    }
  }
  a[target] = 1;
  return 1;
}
void print_array(int a[], int n) {
  int i = 0;
  for (i = 0; i < n - 1; i++) printf("%d ", a[i]);
  printf("%d\n", a[i]);
}
int main() {
  int n = 0;
  scanf("%d", &n);
  int a[10000 + 1];
  a[0] = 0;
  a[1] = 0;
  for (int i = 2; i <= 10000; i++) {
    a[i] = -1;
  }
  for (int i = 2; i <= 10000; i++) {
    if (isprime(a, i, 10000)) {
      for (int j = 2; j * i <= 10000; j++) {
        a[j * i] = 0;
      }
    }
  }
  int res = 0;
  int index;
  for (int i = 0; i < n; i++) {
    scanf("%d", &index);
    res += a[index];
  }
  printf("%d\n", res);
  return 0;
}
