#include <bits/stdc++.h>
int main(int argc, char* argv[]) {
  int n, x, p;
  int i, j, sq;
  scanf("%d", &n);
  p = 0;
  for (i = 0; i < n; i++) {
    scanf("%d", &x);
    if (0 < (x % 2)) {
      sq = sqrt(x);
      for (j = 3; j < sq; j += 2) {
        if (0 == (x % j)) {
          break;
        }
      }
      if (sq <= j) {
        p++;
      }
    }
  }
  printf("%d\n", p);
  return (0);
}
