#include <bits/stdc++.h>
using namespace std;
int cnt = 0;
void count1(int b) {
  cout << "b:" << b << endl;
  int i;
  if (b == 2) cnt++;
  if (b == 3) cnt++;
  if (b % 2 != 0 && b % 3 != 0) cnt++;
  i = 3;
  while (i <= sqrt(b)) {
    if (b % i != 0) {
      cnt++;
      break;
    }
    i = i + 2;
  }
}
int main() {
  int n;
  int i;
  cin >> n;
  int a[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (i = 0; i < n; i++) {
    count1(a[i]);
  }
  cout << cnt << endl;
}
