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