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