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