#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; j++) {
      a = pn;
      b = j;
      while (b != 0) {
        tmp = b;
        b = a % b;
        a = tmp;
      }
      if (a == 1)
        pnn *= 1;
      else {
        pnn *= 0;
        break;
      }
    }
    if (pnn == 1) pnc += 1;
  }
  cout << pnc << endl;
  return 0;
}
