#include <bits/stdc++.h>
using namespace std;
int GCB(int x, int y) {
  int z = y;
  y = x % y;
  x = z;
  if (y == 0) return x;
  return GCB(x, y);
}
int PrimeNumbers(vector<int> A) {
  int count = 0;
  for (int i = 0; i < A.size(); i++) {
    for (int j = 2; j < A[i]; j++) {
      if (GCB(A[i], j) != 1) {
        count++;
        break;
      }
    }
  }
  return A.size() - count;
}
int main() {
  int n;
  cin >> n;
  vector<int> A;
  A.resize(n);
  for (int i = 0; i < n; i++) cin >> A[i];
  cout << PrimeNumbers(A) << endl;
  return 0;
}
