#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;
    for (int j = 1; j <= a / 2; j++) {
      d = a % j;
      if (d == 0) {
        b++;
      }
    }
    if (b == 1) {
      c++;
    }
  }
  cout << c << endl;
  return 0;
}
