#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, cnt = 0;
  cin >> n;
  long N;
  while (cin >> N) {
    long sqr = sqrt(N);
    if (sqr < 2) {
      cnt++;
      continue;
    }
    for (long j = 2; j <= sqr; j++) {
      if ((N % j) == 0) {
        cnt++;
        break;
      }
    }
  }
  cout << cnt << endl;
  return 0;
}
