#include <bits/stdc++.h>
using namespace std;
bool sieve[10000 + 1];
int main() {
  for (int i = 2; i <= 10000; ++i) {
    sieve[i] = true;
  }
  for (int i = 2; i <= 10000; i++) {
    if (sieve[i]) {
      for (int j = 2 * i; j <= 10000; j += i) {
        sieve[j] = false;
      }
    }
  }
  vector<int> inputs;
  int n;
  cin >> n;
  int prime_count = 0;
  for (int i = 0; i < n; ++i) {
    int input;
    cin >> input;
    if (sieve[input] == true) ++prime_count;
  }
  cout << prime_count << endl;
}
