#include <bits/stdc++.h>
int main() {
  int n, i, input, count = 0, frag;
  scanf("%d", &n);
  for (; n != 0; n--) {
    scanf("%d", &input);
    {
      for (i = 2, frag = 1; i < input; i++) {
        if (input % i == 0) frag = 0;
      }
    }
    if (frag && input > 1) count++;
  }
  printf("%d\n", count);
  return 0;
}
