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