#include <bits/stdc++.h>
int main() {
  int n, i, j, count = 0, flag;
  int *p;
  scanf("%d", &n);
  p = (int *)malloc(n * sizeof(int));
  for (i = 0; i < n; i++) scanf("%d", &p[i]);
  for (j = 0; j < n; j++) {
    flag = 0;
    for (i = 2; i < p[j]; i++) {
      if (p[j] % i == 0) {
        flag = 1;
      }
    }
    if (flag == 0) count++;
  }
  printf("%d\n", count);
  free(p);
  return 0;
}
