#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  vector<int> vec;
  vector<int> vecin;
  int count = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> m;
    vecin.push_back(m);
  }
  for (int i = 2; i <= m; i++) {
    vec.push_back(i);
  }
  for (vector<int>::iterator iter = vec.begin(); iter != vec.end(); ++iter) {
    vector<int>::iterator it = iter;
    ++it;
    while (it != vec.end()) {
      if ((*it) % (*iter) == 0) {
        it = vec.erase(it);
      } else {
        ++it;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (auto iter = vec.begin(); iter != vec.end(); ++iter) {
      if (vecin[i] == (*iter)) {
        count++;
        break;
      }
      if (vecin[i] < (*iter)) {
        break;
      }
    }
  }
  cout << count << endl;
  return 0;
}
