#include <bits/stdc++.h>
using namespace std;
static const int WHITE = 1;
static const int BLACK = 0;
int P[10000];
int color[10000];
int cnt = 0;
void prime(int n) {
  for (int i = 0; i < n; i++) {
    if (color[i] != BLACK) {
      for (int j = 3; j * j <= i; j += 2) {
        if (P[i] % j == 0) {
          color[i] = BLACK;
        }
      }
    }
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> P[i];
    color[i] = WHITE;
  }
  for (int i = 0; i < n; i++) {
    if (i == 2) continue;
    if (P[i] % 2 == 0) color[i] = BLACK;
  }
  prime(n);
  for (int i = 0; i < n; i++) {
    if (color[i] == WHITE) {
      cnt++;
    }
  }
  cout << cnt << endl;
}
