#include <bits/stdc++.h>
int main(void) {
  int a[10000], b[10000], i, j, k, l = 0, n, m;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  for (j = 0; j < n; j++) {
    m = 0;
    for (k = 1; k <= a[j]; k++) {
      if (a[j] % k == 0) m++;
      if (m > 2) break;
    }
    if (m == 2) l++;
  }
  printf("%d\n", l);
  return 0;
}
