#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream& operator<<(ostream& out, const vector<vector<T> >& v) {
  for (size_t i = 0; i < v.size(); ++i) {
    out << v[i] << endl;
  }
  return out;
}
template <typename T>
ostream& operator<<(ostream& out, const vector<T>& v) {
  out << "[";
  size_t last = v.size() - 1;
  for (size_t i = 0; i < v.size(); ++i) {
    out << v[i];
    if (i != last) {
      out << ",";
    }
  }
  out << "]";
  return out;
}
const int maxn = 10010;
bool p[maxn];
int n;
void eratos() {
  p[0] = p[1] = true;
  for (int i = 0; i < maxn; ++i) {
    if (p[i]) {
      continue;
    }
    for (int j = i + i; j < maxn; j += i) {
      p[j] = true;
    }
  }
}
void solve() {
  eratos();
  cin >> n;
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    int k;
    cin >> k;
    if (!p[k]) {
      ans++;
    }
  }
  cout << ans << endl;
}
int main() { solve(); }
