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