#include <bits/stdc++.h>
using namespace std;
bool isprime(const int n, set<int>& known) {
  int checked;
  for (auto& it : known) {
    if (n == it) {
      return true;
    } else if (n % it == 0) {
      return false;
    }
    checked = it;
  }
  for (int i = checked + 1; i * i < n; i++) {
    if (n % i == 0) {
      return false;
    }
  }
  return true;
}
int main() {
  int N;
  cin >> N;
  cin.ignore();
  set<int> knownprimes{2, 3, 5, 7};
  set<int> given;
  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    cin.ignore();
    given.insert(a);
  }
  int count = 0;
  for (auto& it : given) {
    if (isprime(it, knownprimes)) {
      count++;
    }
  }
  cout << count << endl;
  return 0;
}
