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