#include <bits/stdc++.h>
int main() {
  int n, count = 0, i, a[10000], b, j;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  for (i = 0; i < n; i++) {
    if (a[i] == 2) {
      count++;
      continue;
    }
    for (j = 3; j <= a[i] / j; j += 2) {
      if (a[i] % 2 == 0) {
        continue;
      }
    }
    if (a[i] % 2 == 0) {
      continue;
    } else {
      count++;
      continue;
    }
  }
  printf("%d\n", count);
  return 0;
}
