#include <bits/stdc++.h>
using namespace std;
int main() {
  int A[10000] = {0}, N, count = 0;
  cin >> N;
  for (int i = 0; i < N; i++) cin >> A[i];
  for (int i = 0; i < N; i++) {
    if (A[i] == 2) {
      count++;
      i++;
    } else if (A[i] % 2 == 0)
      i++;
    for (int j = 2; j <= A[i] - 1; j++) {
      if (A[i] % j == 0)
        break;
      else if (j == A[i] - 1) {
        count++;
      }
    }
  }
  cout << count << endl;
  return 0;
}
