#include <bits/stdc++.h>
using namespace std;
bool isPrimeNumber(int n) {
  if (n < 2) return false;
  bool notExists = true;
  for (int i = 2; i < n - 1 && notExists; i++) notExists = n % i != 0;
  return notExists;
}
int main() {
  int n, tmp;
  cin >> n;
  vector<int> v;
  for (int i = 0; i < n; i++) {
    cin >> tmp;
    v.push_back(tmp);
  }
  int count = 0;
  for (auto &i : v)
    if (isPrimeNumber(i)) count++;
  cout << count << endl;
  return 0;
}
