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