#include <bits/stdc++.h>
int prime[10001] = {};
void eratos_sieve() {
  int i, j;
  for (i = 2; i <= 10000; i++) {
    if (!prime[i]) {
      prime[i] = 2;
      for (j = i * 2; j <= 10000; j += i) prime[j] = 1;
    }
  }
}
int main() {
  int n, a, i, j;
  int ans = 0, check = 0;
  eratos_sieve();
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a);
    if (a < 10001) {
      ans += prime[a] == 2;
      continue;
    }
    for (j = 2; j <= (int)1e4 && j <= a; j++) {
      if (prime[j] != 2) continue;
      check += !(a % j);
    }
    ans += !check;
  }
  printf("%d\n", ans);
  return 0;
}
