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