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