#include <bits/stdc++.h>
using namespace std;
int const SIZ = 10001;
bitset<SIZ> isprime;
void sieve() {
  isprime.set();
  isprime.set(0, 0);
  isprime.set(1, 0);
  for (int i = 4; i < SIZ; i += 2) {
    isprime.set(i, 0);
  }
  for (int i = 3; i * i < SIZ; i += 2) {
    if (!isprime[i]) continue;
    for (int j = 2; i * j < SIZ; ++j) {
      isprime.set(i * j, 0);
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  sieve();
  int m, ans = 0;
  for (int i = 0; i < n; ++i) {
    cin >> m;
    if (isprime[m]) {
      ++ans;
      isprime.set(m, 0);
    }
  }
  cout << ans << endl;
  return 0;
}
