#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int datanum;
  int notprimenum;
  int data;
  int divnum;
  int integer;
  notprimenum = 0;
  cin >> datanum;
  for (int i = 0; i < datanum; i++) {
    cin >> data;
    if (data == 1) {
      notprimenum++;
      continue;
    }
    for (divnum = data / 2, integer = 1; divnum > 1;
         divnum = data / (++integer)) {
      if (data % divnum == 0) {
        notprimenum++;
        break;
      }
    }
  }
  cout << datanum - notprimenum << endl;
  return 0;
}
