#include <bits/stdc++.h>
using namespace std;
int main() {
  bool p[10001] = {false};
  p[2] = true;
  p[3] = true;
  for (int i = 3; i < 10001; i += 2) {
    bool f = false;
    for (int j = 3; j <= sqrt(i); j += 2) {
      if (i % j == 0) {
        f = true;
        break;
      }
    }
    if (!f) p[i] = true;
  }
  int n;
  int a;
  int count = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (p[a]) count++;
  }
  cout << count << endl;
}
