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