#include <bits/stdc++.h>
using namespace std;
bool Ispn(int a) {
  int count = 0;
  if (a < 2) return false;
  if (a == 2) return true;
  if ((a & 1) == 0) return false;
  for (int i = 1; i <= a; i++) {
    if (a % i == 0) {
      count++;
    }
    if (count > 2) break;
  }
  if (count == 2) {
    return true;
  } else {
    return false;
  }
}
int main() {
  ios::sync_with_stdio(false);
  int num[10000];
  int pn = 0;
  int count = 0;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> num[i];
  }
  for (int i = 0; i < n; i++) {
    if (Ispn(num[i]) == true) {
      pn++;
    }
  }
  cout << pn << endl;
  return 0;
}
