#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int p = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int m;
    cin >> m;
    if (m == 2) {
      p++;
      continue;
    }
    if (m < 2 || m % 2 == 0) continue;
    int e = 0;
    for (int j = 3; j < sqrt(m); j++) {
      if (m % j == 0) {
        e = 1;
        break;
      }
    }
    if (e == 0) p++;
  }
  cout << p << endl;
  return 0;
}
