#include <bits/stdc++.h>
using namespace std;
int main() {
  bool primes[10001] = {};
  for (int i = (2); i < (100 + 1); i++) {
    if (primes[i] == 0) {
      for (int j = (2); j < ((10000 / i) + 1); j++) {
        primes[i * j] = 1;
      }
    }
  }
  int n;
  cin >> n;
  int cnt = 0;
  for (int i = 0; i < (n); i++) {
    int a;
    cin >> a;
    if (primes[a] == 0) cnt++;
  }
  cout << cnt;
  return 0;
}
