#include <bits/stdc++.h>
using namespace std;
set<int> prime(int d) {
  vector<bool> arr(d + 1, true);
  arr[0] = arr[1] = false;
  for (int i = 2; i * i <= d; i++) {
    if (!arr[i]) continue;
    for (int j = i + 1; j <= d; j++) {
      if (j % i == 0) {
        arr[j] = false;
      }
    }
  }
  set<int> p;
  for (int i = 0; i <= d; i++) {
    if (arr[i]) {
      p.insert(i);
    }
  }
  return p;
}
int main(int argc, char* argv[]) {
  int N;
  cin >> N;
  int m = 0;
  vector<int> in;
  for (int i = 0; i < N; i++) {
    int d;
    cin >> d;
    in.push_back(d);
    m = max(m, d);
  }
  set<int> p = prime(m);
  int ans = 0;
  for (int i = 0; i < N; i++) {
    if (p.find(in[i]) != p.end()) ans++;
  }
  cout << ans << endl;
  return 0;
}
