#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b, c = 0, d, e;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    b = 0;
    e = a % 2;
    if (e == 0 && a != 2) continue;
    if (a == 2) {
      c++;
    } else {
      for (int j = 1; j <= a / 2; j += 2) {
        d = a % j;
        if (d == 0) {
          b++;
        }
        if (b == 2) break;
      }
      if (b == 1) {
        c++;
      }
    }
  }
  cout << c << endl;
  return 0;
}
