#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ans = 0;
  vector<int> num(10000);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> num[i];
  }
  vector<int> pm(1);
  pm[0] = 2;
  for (int j = 3; j <= 100000000; j++) {
    for (int k = 0; k < pm.size(); k++) {
      if (j % pm[k] == 0) break;
      if (k == pm.size() - 1 && j % pm[k] != 0) {
        pm.push_back(j);
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < pm.size(); j++) {
      if (num[i] % pm[j] == 0) {
        if (num[i] == pm[j]) {
          ans++;
        }
        break;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
