#include <bits/stdc++.h>
using namespace std;
int couent = 0;
int keisann(int a) {
  for (int i = 2; i < a; i++) {
    if (a % i == 0) {
      return 0;
    }
  }
  couent++;
}
int main() {
  int dataset;
  cin >> dataset;
  for (size_t i = 0; i < dataset; i++) {
    int a;
    cin >> a;
    keisann(a);
  }
  cout << couent << endl;
}
