#include <bits/stdc++.h>
using namespace std;
std::vector<bool> isNotPrime(int max) {
  std::vector<bool> is_not_prime(max + 1);
  for (int i = 2; i <= max / 2; i++) {
    int j = i * 2;
    while (j <= max) {
      is_not_prime[j] = true;
      j += i;
    }
  }
  return is_not_prime;
}
int main(int argc, char* argv[]) {
  int n, max = 0, cnt = 0, num;
  cin >> n;
  std::vector<int> a(n);
  std::vector<bool> is_not_prime;
  for (int i = 0; i < n; i++) {
    cin >> num;
    a[i] = num;
    if (num > max) {
      max = num;
    }
  }
  is_not_prime = isNotPrime(max);
  for (int i = 0; i < n; i++) {
    if (is_not_prime[a[i]] == false) {
      cnt++;
    }
  }
  cout << cnt << endl;
  return 0;
}
