#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, count = 0;
  vector<int> N;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    int j;
    cin >> j;
    N.push_back(j);
  }
  for (int i = 0; i < n; ++i) {
    bool flag = true;
    for (int j = 2; j < N[i]; ++j) {
      if (N[i] % j == 0) {
        flag = false;
      }
    }
    if (flag) ++count;
  }
  cout << count << endl;
  return 0;
}
