#include <bits/stdc++.h>
using namespace std;
int s[100000] = {};
bool judge(int n) {
  bool j = true;
  for (int i = 0; s[i] * s[i] <= n; i++) {
    if (s[i] == 0) {
      break;
    }
    if (n % s[i] == 0) {
      j = false;
    }
  }
  return j;
}
int main() {
  s[0] = 2;
  int c = 1;
  for (int i = 3; i < 20000; i++) {
    if (judge(i)) {
      s[c] = i;
      c++;
    }
  }
  int n, a[20000] = {};
  cin >> n;
  int count = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    for (int t = 0; s[t] <= a[i]; t++) {
      if (a[i] == s[t]) {
        count++;
      }
    }
  }
  cout << count << endl;
  return 0;
}
