#include <bits/stdc++.h>
using namespace std;
int pn(int num) {
  int i = num - 1;
  if (num == 2) return 1;
  while (i >= 2) {
    if (num % i == 0) {
      return 0;
    } else if (num % 2 == 0) {
      return 0;
    }
    i -= 1;
  }
  return 1;
}
int main() {
  int n;
  int num;
  int cnt = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> num;
    cnt += pn(num);
  }
  cout << cnt << endl;
  return 0;
}
