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