#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, cnt = 0;
  cin >> n;
  int d[n], max = -1;
  for (int i = 0; i < n; i++) {
    cin >> d[i];
    max = d[i] > max ? d[i] : max;
  }
  vector<int> primes = {2};
  for (int i = 3; i <= sqrt(max); i++) {
  BREAK:
    for (int k = 0; k < primes.size(); k++) {
      if (i % primes[k] == 0) {
        i++;
        goto BREAK;
      }
    }
    primes.push_back(i);
  }
  for (int i = 0; i < n; i++) {
  BREAK2:
    for (int k = 0; sqrt(d[i]) >= primes[k] && k < primes.size(); k++) {
      if (d[i] % primes[k] == 0) {
        i++;
        goto BREAK2;
      }
    }
    cnt++;
  }
  cout << cnt << endl;
  return 0;
}
