#include <bits/stdc++.h>
long long a[100000000];
int main() {
  long long i, j, s = 0, c, n;
  a[1] = 1;
  for (i = 4; i <= 100000000; i = i + 2) {
    a[i] = 1;
  }
  for (i = 3; i * i <= 100000000; i += 2) {
    if (a[i] != 1) {
      for (j = i * i; j <= 100000000; j = j + 2 * i) {
        a[j] = 1;
      }
    }
  }
  scanf("%lld", &n);
  while (n--) {
    scanf("%lld", &c);
    if (a[c] == 0) s++;
  }
  printf("%lld\n", s);
  return 0;
}
