#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, x, total = 0;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> x;
    for (j = 2; j <= x / 2; j++) {
      if (x == 3) total++;
      if (j == x / 2) total++;
      if (x % j == 0) break;
    }
  }
  cout << total << endl;
}
