#include <bits/stdc++.h>
using namespace std;
bool primeJudge(int i) {
  for (int j = 2; j <= i / 2; j++) {
    if (i % j == 0) {
      return false;
    }
  }
  return true;
}
int main() {
  int n;
  cin >> n;
  vector<long> n_nums(n);
  for (int i = 0; i < n; i++) {
    cin >> n_nums[i];
  }
  int prime_count = 0;
  for (int i = 0; i < n; i++) {
    if (primeJudge(n_nums[i])) {
      prime_count += 1;
    }
  }
  cout << prime_count << endl;
  return 0;
}
