#include <bits/stdc++.h>
using namespace std;
bool *sieve;
int limit;
void makeSieve() {
  fill_n(sieve, limit + 1, false);
  sieve[0] = sieve[1] = false;
  for (int i = 4; i < limit + 1; i += 2) {
    sieve[i] = false;
  }
  for (int i = 3; i < sqrt(limit + 1); i += 2) {
    if (!sieve[i]) continue;
    for (int j = i * i; j < limit + 1; j += i) {
      sieve[j] = false;
    }
  }
}
int main() {
  int n;
  cin >> n;
  vector<int> elements;
  limit = 0;
  while (n--) {
    int tmp;
    cin >> tmp;
    elements.push_back(tmp);
    limit = max(limit, tmp);
  }
  sieve = new bool[limit + 1];
  makeSieve();
  int num = 0;
  for (int i = 0; i < (int)elements.size(); ++i) {
    num += (int)sieve[elements[i]];
  }
  cout << num << endl;
  delete[] sieve;
  return 0;
}
