#include <bits/stdc++.h>
using namespace std;
int cnt = 0;
void count1(int b) {
  int i;
  if (sqrt(b) <= 4) {
    if (b == 2) cnt++;
    if (b == 3) cnt++;
    if (b % 2 != 0 && b % 3 != 0) cnt++;
  } else {
    i = 3;
    while (i <= sqrt(b)) {
      if (b % i != 0) {
        cnt++;
        break;
      }
      i = i + 2;
    }
  }
}
int main() {
  int n;
  int i;
  cin >> n;
  double a[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (i = 0; i < n; i++) {
    count1(a[i]);
  }
  cout << cnt << endl;
}
