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