#include <bits/stdc++.h>
int main(void) {
  unsigned int input, answer = 0, x, y;
  long prime[10000];
  scanf("%u", &input);
  for (x = 0; input > x; x++) {
    scanf("%ld", &prime[x]);
  }
  for (x = 0; input > x; x++) {
    for (y = 2; prime[x] >= y; y++) {
      if (0 == prime[x] % y) break;
    }
    if (prime[x] == y) {
      answer += 1;
    }
  }
  printf("%u\n", answer);
  return 0;
}
