#include <bits/stdc++.h>
int main() {
  int i, s, count = 0, l, count2 = 0, n = 0;
  scanf("%d", &l);
  while (n < l) {
    scanf("%d", &s);
    n++;
    if (s < 2)
      continue;
    else if (s == 2) {
      count++;
      continue;
    }
    if (n % 2 == 0) continue;
    for (i = 3; i <= s / i; i += 2) {
      if (s % i == 0) count--;
      break;
    }
    count++;
  }
  printf("%d\n", count);
}
