#include <bits/stdc++.h>
using namespace std;
namespace {
bool IsPrime(unsigned int x) {
  for (size_t i = 2; i < x; ++i) {
    if (x % i == 0) {
      return false;
    }
  }
  return true;
}
}  // namespace
int main() {
  unsigned int n;
  cin >> n;
  unsigned int x;
  unsigned int c = 0;
  for (unsigned int i = 0; i < n; ++i) {
    cin >> x;
    if (IsPrime(x)) {
      ++c;
    }
  }
  cout << c << endl;
  return 0;
}
