#include <bits/stdc++.h>
using namespace std;
int prime(vector<int>& t, vector<bool>& p, int n) {
  int sum = 0;
  p.at(0) = false;
  p.at(1) = false;
  for (int i = 2; i < n; i++) {
    if (p.at(i)) {
      sum++;
      t.at(i) = sum;
      int j = i + i;
      while (j < n) {
        p.at(j) = false;
        j += j;
      }
    } else {
      t.at(i) = sum;
    }
  }
}
template <class T>
void print(vector<T>& A, int N) {
  string sep = "";
  for (int i = 0; i < N; i++) {
    cout << sep << A.at(i);
    sep = " ";
  }
  cout << endl;
}
int main() {
  int n;
  cin >> n;
  vector<int> V(n);
  int max = 0;
  for (int i = 0; i < n; i++) {
    cin >> V.at(i);
    if (V.at(i) > max) {
      max = V.at(i);
    }
  }
  vector<int> t(max + 1, 0);
  vector<bool> p(max + 1, true);
  prime(t, p, max + 1);
  int sum = 0;
  for (int v : V) {
    if (p.at(v)) {
      sum++;
    }
  }
  cout << sum << endl;
}
