#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, count = 0, allcount = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> m;
    for (int j = 1; j < m / 2 + 1; j++) {
      if (m % j == 0) count++;
      if (count > 1) break;
    }
    if (count < 2) allcount++;
    count = 0;
  }
  cout << allcount << endl;
  return 0;
}
