#include <bits/stdc++.h>
using namespace std;
set<int> prime(int d) {
  int n = d / 32 + 1;
  vector<unsigned long> arr(n, -1);
  set<int> p;
  for (int i = 2; i <= d; i++) {
    int indx = i / 32;
    int offset = (i % 32) - 1;
    if (((arr[indx] >> offset) & 1) == 0) continue;
    p.insert(i);
    for (int j = 2; j * i <= d; j++) {
      int indx = j * i / 32;
      int offset = (j * i % 32) - 1;
      if (((arr[indx] >> offset) & 1) == 0) continue;
      arr[indx] ^= (1 << offset);
    }
  }
  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;
}
