#include <bits/stdc++.h>
using namespace std;
int main() {
  bool sosu[10001];
  for (int i = 2; i <= 10000; i++) {
    sosu[i] = true;
  }
  for (int i = 2; i <= 10000; i++) {
    if (sosu[i] == true) {
      for (int ii = i * 2; ii <= 10000; ii += i) {
        sosu[ii] = false;
      }
    }
  }
  int time, ansa = 0;
  cin >> time;
  int suuti;
  for (int i = 0; i < time; i++) {
    cin >> suuti;
    if (sosu[suuti] == true) {
      ansa++;
    }
  }
  cout << ansa << endl;
  return 0;
}
