#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, count = 0, i, j;
  cin >> n;
  int list[n];
  for (i = 0; i < n; i++) cin >> list[i];
  for (i = 0; i < n; i++) {
    if (list[i] == 2 || list[i] == 3) {
      count++;
      continue;
    }
    if (list[i] >= 3 && list[i] % 2 == 0) continue;
    for (j = 2; j < sqrt(list[i]); j++)
      if (list[i] % j == 0) break;
    if (i >= sqrt(list[i])) count++;
  }
  cout << count << endl;
}
