#include <bits/stdc++.h>
int main(void) {
  int n, i, j, r, counter = 0, count = 0;
  int array[10000];
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%d", &array[i]);
  for (i = 0; i < n; i++) {
    counter = 0;
    for (j = 1; j <= array[i]; j++) {
      r = array[i] % j;
      if (r == 0) {
        counter += 1;
      }
    }
    if (counter == 2) {
      count += 1;
    }
  }
  printf("%d\n", count);
  return 0;
}
