#include <bits/stdc++.h>
using namespace std;
struct cww {
  cww() {
    ios::sync_with_stdio(false);
    cin.tie(0);
  }
} star;
int main() {
  int n;
  cin >> n;
  vector<int> v;
  v.reserve(n);
  int cnt = 0, tmp;
  for (int i = (0), i_len = (n); i < i_len; ++i) {
    cin >> tmp;
    if (tmp == 2 || tmp == 3 || tmp == 5 || tmp == 7)
      ++cnt;
    else if (tmp % 2 != 0 && tmp % 3 != 0 && tmp % 5 != 0 && tmp % 7 != 0)
      v.emplace_back(tmp);
  }
  if (((int)(v).size()) == 0) {
    cout << (cnt) << endl;
    return 0;
  }
  sort((v).begin(), (v).end());
  vector<int> so{2};
  so.reserve(10000);
  int max_v = *max_element((v).begin(), (v).end());
  for (int i = 3; i <= max_v; i += 2) {
    bool flg = false;
    for (int j = (0), j_len = (((int)(so).size())); j < j_len; ++j) {
      if (i % so[j] == 0) {
        flg = true;
        break;
      }
    }
    if (flg) continue;
    so.emplace_back(i);
    cnt += count((v).begin(), (v).end(), i);
  }
  cout << (cnt) << endl;
  return 0;
}
