#include <bits/stdc++.h>
using int_t = std::int64_t;
using uint_t = std::uint64_t;
using bit_t = uint_t;
using intset_t = std::set<int_t>;
static bool witness(int_t a, int_t n, int_t t, int_t u);
static uint_t modular_exponentiation(uint_t a, uint_t b, uint_t n);
bool miller_rabin(int_t n) {
  if (((!(n & 0x01)) && n != 2) || (n < 2) || ((n % 3 == 0) && (n != 3))) {
    return false;
  }
  if (n <= 3) {
    return true;
  }
  int_t t = 1, u = n / 2;
  while (!(u & 0x01)) {
    t = t + 1;
    u /= 2;
  }
  const int_t a[] = {2, 7, 61, -1};
  for (int i = 0; a[i] < n && a[i] != -1; i++) {
    if (witness(a[i], n, t, u)) {
      return false;
    }
  }
  return true;
}
bool witness(int_t a, int_t n, int_t t, int_t u) {
  int_t x = modular_exponentiation(a, u, n);
  int_t y = x;
  for (int i = 0; i < t; i++) {
    y = (x * x) % n;
    if (y == 1 && x != 1 && x != (n - 1)) {
      return true;
    }
    x = y;
  }
  return y != 1;
}
uint_t modular_exponentiation(uint_t a, uint_t b, uint_t n) {
  uint_t d = 1;
  while (b > 0) {
    if (b & 0x01) {
      d = (d * a) % n;
    }
    a = (a * a) % n;
    b >>= 1;
  }
  return d;
}
int main() {
  using namespace std;
  int n, m, p = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> m;
    if (miller_rabin(m)) {
      p = p + 1;
    }
  }
  cout << p << endl;
  return 0;
}
