#include <bits/stdc++.h>
using namespace std;
int main() {
  int ans = 0;
  int n;
  vector<bool> isprime(10004);
  for (int i = 0; i < isprime.size(); ++i) {
    isprime[i] = true;
  }
  isprime[0] = isprime[1] = false;
  for (int i = 2; i < 10001; i++) {
    if (!isprime[i]) {
      continue;
    }
    for (int j = i * 2; j < 10002; j += i) {
      isprime[j] = false;
    }
  }
  cin >> n;
  for (int i = 0; i < n; ++i) {
    int u;
    cin >> u;
    if (isprime[u]) {
      ++ans;
    }
  }
  cout << ans;
  cout << endl;
  return 0;
}
