#include <bits/stdc++.h>
using namespace std;
int prime(double m) {
  int i;
  if (int(m) % 2 == 0) return 0;
  for (i = 3; i <= sqrt(m); i += 2) {
    if (int(m) % i == 0) {
      return 0;
    }
  }
  return 1;
}
int main(void) {
  int i, n, sum;
  double m;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> m;
    if (m / 2 == 1 || prime(m) == 1) {
      sum++;
      cout << "m=" << m << endl;
    }
  }
  cout << sum << endl;
  return 0;
}
