#include <bits/stdc++.h>
int main() {
  int n, x, y, z, i = 0, h = 0, j = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &x);
    if (x >= 2) {
      for (y = 2; y <= x; y++) {
        z = x % y;
        if (z == 0) h++;
        if (h >= 2) break;
      }
      if (h == 1) j++;
      h = 0;
    }
  }
  printf("%d\n", j);
  return 0;
}
