#include <bits/stdc++.h>
int main() {
  int n, i, k, a, in = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a);
    for (k = 2; k <= a; k++) {
      if (a == 2 || a == 3) {
        in++;
        break;
      }
      if (6 * k - 1 == a || 6 * k + 1 == a) {
        in++;
        break;
      }
      if (a % k == 0 && a != k) break;
      if (k > ((double)a / 2)) {
        in++;
        break;
      }
    }
  }
  printf("%d\n", in);
  return 0;
}
