#include <bits/stdc++.h>
int main(void) {
  int n, i, j, sosu = 0, seisu[10000], co = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &seisu[i]);
  }
  for (i = 0; i < n; i++) {
    for (j = 3; j <= seisu[i] / 2 + 1; j = j + 2) {
      if ((seisu[i] % 2 == 0) || (seisu[i] % j == 0)) {
        co = 1;
        break;
      }
    }
    if (co != 1) {
      sosu++;
    }
    co = 0;
  }
  printf("%d\n", sosu);
  return 0;
}
