#include <bits/stdc++.h>
using namespace std;
vector<int> n;
vector<int> solute(vector<bool> *p) {
  int count = (*p).size();
  for (int i = 2; i * i < count; i++) {
    if (!(*p).at(i)) {
      for (int j = i; j * i < count; j++) {
        (*p)[i * j] = true;
      }
    }
  }
}
int main(void) {
  int count, temp, ans = 0;
  cin >> count;
  for (int i = 0; i < count; i++) {
    cin >> temp;
    n.push_back(temp);
  }
  sort(n.begin(), n.end());
  vector<bool> pri(n.back() + 1, 0);
  solute(&pri);
  for (int i = 0; i < count; i++) {
    if (!pri.at(n.at(i))) ans++;
  }
  cout << ans << endl;
  return 0;
}
