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