#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  unordered_map<int, bool> m;
  auto isPrime = [&m](int nn) {
    auto it = m.find(nn);
    if (it != end(m)) {
      return it->second;
    }
    for (int i = 2; i < nn; ++i) {
      if (nn % i == 0) {
        m[nn] = false;
        return false;
      }
    }
    m[nn] = true;
    return true;
  };
  int count{0};
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    if (isPrime(x)) {
      count += 1;
    }
  }
  cout << count << endl;
}
