#include <bits/stdc++.h>
using namespace std;
bool primeChecker(int object) {
  assert(object > 1);
  int i = 2;
  while (i * i <= object) {
    if (object % i == 0) return false;
    i++;
  }
  return true;
}
int main() {
  int n;
  int counter = 0;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    int tmp;
    cin >> tmp;
    if (!primeChecker(tmp)) counter++;
  }
  cout << counter << endl;
  return 0;
}
