#include <bits/stdc++.h>
int main() {
  int n, i, q, j, t, p = 0, u = 0, o = 0;
  scanf("%d", &n);
  if (n < 1 || 10000 < n) exit(0);
  for (i = 0; i < n; i++) {
    scanf("%d", &q);
    if (q < 2 || 100000000 < q) exit(0);
    if (q != 2 && q % 2 == 0) continue;
    p = 1;
    for (j = 2; j < q; j++) {
      t = q % j;
      if (q != 2 && t == 0) {
        p = 0;
        break;
      }
    }
    if (p == 1) o++;
  }
  printf("%d\n", o);
  return 0;
}
