#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[10010], t, A = 0;
  double s;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    s = sqrt(a[i]);
    t = (int)s;
    for (int j = 2; j <= t; j++) {
      if (j == t) A++;
      if (a[i] % j == 0) break;
    }
  }
  cout << A << endl;
  return 0;
}
