#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  deque<int> d;
  vector<bool> v(1000000);
  constexpr auto size = 123456 * 2;
  d.resize(size - 1);
  iota(begin(d), end(d), 2);
  const int cut = sqrt(size);
  while (d[0] < cut) {
    v[d[0]] = true;
    d.erase(
        remove_if(begin(d), end(d), [n = d[0]](int x) { return x % n == 0; }),
        end(d));
  }
  for (auto&& i : d) {
    v[i] = true;
  }
  int count{0};
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    if (v[x]) {
      count += 1;
    }
  }
  cout << count << endl;
}
