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