#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  bool isNotPrime[10000] = {};
  cin >> n;
  int count = 0;
  for (int i = 2; i < 10000; i++) {
    if (isNotPrime[i]) {
      continue;
    }
    for (int j = 2; i * j < 10000; j++) {
      isNotPrime[i * j] = true;
    }
  }
  for (int i = 0; i < n; i++) {
    cin >> k;
    if (!isNotPrime[k]) {
      count++;
    }
  }
  cout << count << endl;
  return 0;
}
