#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a;
  int c = 0;
  for (int i = 0; i < n; i++) {
    cin >> a;
    bool f = true;
    for (int t = 2; t < a; t++) {
      if (a / t * t == a) {
        f = false;
        break;
      }
    }
    if (f) {
      c++;
    }
  }
  cout << c << endl;
  return 0;
}
