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