#include <bits/stdc++.h>
int main() {
  int A, sum = 1, i, yakusuu = 0, loop, j, kazu = 0;
  scanf("%d", &loop);
  if (loop > 10000) {
    printf("error\n");
    exit(1);
  }
  for (j = 1; j <= loop; j++) {
    scanf("%d", &A);
    if (A == 1)
      continue;
    else if (A == 2)
      kazu++;
    else if (A == 3)
      kazu++;
    else if ((A % 2) == 0)
      continue;
    else if ((A % 3) == 0)
      continue;
    else {
      yakusuu = 0;
      for (i = 5; i < sqrt(A); i += 2) {
        if ((A % i) == 0) yakusuu++;
      }
      if (yakusuu == 0) kazu++;
    }
  }
  printf("%d\n", kazu);
  return 0;
}
