#include <bits/stdc++.h>
using namespace std;
int gcd(int x, int y) {
  if (x < y) return gcd(y, x);
  if (!y) return x;
  return gcd(y, x % y);
}
int main(void) {
  int N;
  cin >> N;
  vector<int> prime(576145, 100000000), A(N);
  for (auto &i : A) cin >> i;
  sort(A.begin(), A.end());
  bool is_prime;
  auto pmax = A[N - 1];
  int count = 1;
  prime[0] = 2;
  for (int m = 3; m <= pmax; m += 2) {
    is_prime = true;
    for (int i = 0; i < count; i++) {
      if (prime[i] * prime[i] > m) break;
      if (!(m % prime[i])) {
        is_prime = false;
        break;
      }
    }
    if (is_prime) {
      prime[count] = m;
      count++;
    }
  }
  int ans = 0;
  auto itr = prime.begin();
  for (auto i : A) {
    if (*itr == 100000000) break;
    for (; *itr <= i; itr++) {
      if (*itr == i) {
        ans++;
        continue;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
