#include <bits/stdc++.h>
bool isNotPrime[10000] = {0};
int primes[10000];
int main() {
  int n, k, nprimes = 0;
  scanf("%d", &n);
  int count = 0;
  for (int i = 2; i < 10000; ++i) {
    if (isNotPrime[i]) continue;
    primes[nprimes++] = i;
    for (int j = 2; i * j < 10000; ++j) {
      isNotPrime[i * j] = true;
    }
  }
  for (int i = 0; i < n; ++i) {
    scanf("%d", &k);
    if (k < 10000) {
      if (!isNotPrime[k]) count++;
    } else {
      bool isThisPrime = true;
      for (int p = 0; p < nprimes; ++p) {
        if (k % primes[p] == 0) {
          isThisPrime = false;
          break;
        }
        if (isThisPrime) count++;
      }
    }
  }
  printf("%d\n", count);
  return 0;
}
