#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    int numOfDivisor = 0;
    if (a[i] == 1 || a[i] % 2 == 0) {
      continue;
    }
    for (int j = 3; j < a[i] / 2; j += 2) {
      if (a[i] % j == 0) {
        numOfDivisor++;
      }
    }
    if (numOfDivisor == 0) {
      cnt++;
    }
  }
  cout << cnt << endl;
  return 0;
}
