#include <bits/stdc++.h>
int main() {
  int n, a, i, j, count = 0, frag = 0;
  scanf("%d", &n);
  if (n < 1 || n > 10000) exit(8);
  for (i = 0; i < n; i++) {
    scanf("%d", &a);
    if (a >= 2 && n <= 100000000) {
      if (a == 2) {
        count++;
        continue;
      } else if (a % 2 == 0)
        continue;
      for (j = 2; j < a; j++) {
        if (a % j == 0) frag = 1;
      }
      if (frag == 0) {
        count++;
      }
      frag = 0;
    }
  }
  printf("%d\n", count);
  return 0;
}
