#include <bits/stdc++.h>
typedef std::uint_least32_t ULI;
using namespace std;
bool IsPrime(ULI x);
int main() {
  int n;
  cin >> n;
  cin.clear();
  cin.ignore();
  int sum = 0;
  for (int i = 0; i < n; i++) {
    ULI v;
    cin >> v;
    if (IsPrime(v)) {
      sum++;
    }
  }
  IsPrime(31u);
  cout << sum << "\n";
  return 0;
}
bool IsPrime(ULI x) {
  if (x == 2u) return false;
  if ((x < 2u) || (x % 2 == 0)) return false;
  ULI sq = static_cast<ULI>(sqrt(static_cast<double>(x)) + 1);
  for (ULI i = 3u; i <= sq; i += 2u) {
    if (x % i == 0) return false;
  }
  return true;
}
