#include <bits/stdc++.h>
int main() {
  int i, j, cnt1, cnt2, n, num;
  cnt1 = 0;
  cnt2 = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    cnt2 = 0;
    scanf("%d", &num);
    for (j = 1; j <= num; j++) {
      if (num % j == 0) cnt2++;
      if (cnt2 == 3) break;
    }
    if (cnt2 > 2) cnt1++;
  }
  printf("%d\n", cnt1);
  return 0;
}
