#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, pn, a, b, tmp, pnn, pnc = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> pn;
    pnn = 1;
    for (int j = 2; j < pn / 2 + 1; j++) {
      if ((pnn % 2) || (pnn % 3) || (pnn % 5) || (pnn % 7) || (pnn % 11) ||
          (pnn % 13)) {
        a = pn;
        b = j;
        while (b != 0) {
          tmp = b;
          b = a % b;
          a = tmp;
        }
        if (a == 1)
          pnn *= 1;
        else {
          pnn *= 0;
          break;
        }
      } else
        pnn *= 0;
    }
    if (pnn == 1) pnc += 1;
  }
  cout << pnc << endl;
  return 0;
}
