#include <bits/stdc++.h>
using namespace std;
const int MAX_NUM = 100000000;
vector<bool> ps(MAX_NUM + 1, true);
int main() {
  ps[0] = ps[1] = false;
  for (int i = 2; i <= MAX_NUM; i++) {
    if (!ps[i]) {
      continue;
    }
    for (int j = i + i; j <= MAX_NUM; j += i) {
      ps[j] = false;
    }
  }
  int n;
  cin >> n;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int k;
    cin >> k;
    if (ps[k]) {
      ans++;
    }
  }
  cout << ans << endl;
}
