#include <bits/stdc++.h>
using namespace std;
bool judgeSosu(int n) {
  for (int i = 2; i <= n - 1; i++) {
    if (n % i == 0) return false;
  }
  return true;
}
int main() {
  const int N = 10000;
  int n;
  cin >> n;
  int seisu[N];
  int counter = 0;
  for (int i = 0; i < n; i++) {
    cin >> seisu[i];
  }
  for (int i = 0; i < n; i++) {
    if (judgeSosu(seisu[i])) counter++;
  }
  cout << counter << endl;
}
