#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, count = 0;
  bool judge = true;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> m;
    if (m < 2)
      continue;
    else if (m == 2) {
      count++;
      continue;
    } else if (m % 2 == 0) {
      continue;
    } else {
      for (int j = 3; j < sqrt(m); j++) {
        if (m % j == 0) continue;
      }
      count++;
    }
  }
  cout << count << endl;
  return 0;
}
