#include <bits/stdc++.h>
using namespace std;
int main() {
  int number[10000] = {1};
  int n, c;
  int counter = 0;
  for (int i = 1; i < (int)sqrt(10000.0) + 1; i++) {
    if (number[i] != 1) {
      for (int j = 2; j < 10000 / (i + 1) + 1; j++) {
        number[(i + 1) * j - 1] = 1;
      }
    }
  }
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> c;
    if (number[c - 1] == 0) {
      counter++;
    }
  }
  cout << counter << endl;
  return 0;
}
