#include <bits/stdc++.h>
int main() {
  int n, num, i = 0, j, count = 0, total = 0;
  scanf("%d", &n);
  if (n >= 1 && n <= 10000) {
    while (i < n) {
      scanf("%d", &num);
      if (num <= 2 && num >= 10E8) {
        fprintf(stderr, "数値が大きい\n");
        exit(1);
      } else {
        for (j = 1; j <= num; j++) {
          if (num % j == 0) count++;
        }
        if (count == 2) total++;
        i++;
        count = 0;
      }
    }
    printf("%d\n", total);
  }
  return 0;
}
