#include <bits/stdc++.h>
using namespace std;
const int P_MAX = 1e8;
int main() {
  vector<int> isPrime(P_MAX + 1, 1);
  isPrime[0] = isPrime[1] = 0;
  for (int i = 4; i <= P_MAX; i += 2) {
    isPrime[i] = 0;
  }
  int limit = sqrt(P_MAX);
  for (int i = 3; i <= limit; i += 2) {
    if (!isPrime[i]) {
      continue;
    }
    for (int j = i * 2; j <= P_MAX; j += i) {
      isPrime[j] = 0;
    }
  }
  int n, m;
  scanf("%d", &n);
  int count = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &m);
    count += isPrime[m];
  }
  printf("%d\n", count);
  return 0;
}
