#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int x[10000], y, d, a, b, n;
  double c;
  cin >> n;
  for (a = 0; a < n; a++) {
    cin >> x[a];
  }
  for (a = 0; n > a; a++) {
    c = x[a];
    if (c == 2) {
    } else if (x[a] % 2 == 0) {
      y++;
    } else if (c == 1) {
      y++;
    } else {
      for (b = 3; sqrt(c) >= b; b = b + 2) {
        if (x[a] % b == 0) {
          y++;
          break;
        }
      }
    }
  }
  d = n - y;
  cout << d << endl;
  return 0;
}
