#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int num[10000];
  int pn = 0;
  int count = 0;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> num[i];
  }
  for (int i = 0; i < n; i++) {
    for (int j = 1; j <= num[i]; j++) {
      if (num[i] % j == 0) {
        count++;
        if (count > 2) break;
      }
    }
    if (count == 2) {
      pn++;
    }
    count = 0;
  }
  cout << pn << endl;
  return 0;
}
