#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 / 2 && notExists; i++) notExists = n % i != 0;
  return notExists;
}
int main() {
  int n, count, tmp;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> tmp;
    if (isPrimeNumber(tmp)) count++;
  }
  cout << count << endl;
  return 0;
}
