#include <bits/stdc++.h>
using namespace std;
inline bool IsPrimeSlow(int x) {
  for (int i = x - 1; i > 1; --i)
    if (x % i == 0) return false;
  return true;
}
static bool IsPrime(int x) {
  static unordered_set<int> primes = {2, 3, 5, 7, 11, 13, 17, 19};
  if (primes.find(x) != primes.end()) return true;
  for (auto p : primes) {
    if (x % p == 0) return false;
  }
  if (IsPrimeSlow(x)) {
    primes.insert(x);
    return true;
  }
  return false;
}
int main() {
  int n;
  cin >> n;
  int x;
  int cnt = 0;
  for (int i = 0; i < n; ++i) {
    cin >> x;
    if (IsPrime(x)) ++cnt;
  }
  cout << cnt << endl;
  return 0;
}
