#include <bits/stdc++.h>
using namespace std;
bool snt(int a) {
  if (a == 2 || a == 3 || a == 5 || a == 7) return true;
  if (a < 8) return false;
  int n = sqrt(a);
  for (int i = 7; i < n; i++)
    if (n % i == 0) return false;
  return true;
}
int main() {
  int n, d = 0;
  int b;
  cin >> n;
  while (n-- > 0) {
    cin >> b;
    if (snt(b)) d++;
  }
  cout << d << endl;
  return 0;
}
