#include <bits/stdc++.h>
int main() {
  int ary[10000];
  int i, j, n, flag = 0, scount = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &ary[i]);
  }
  for (i = 0; i < n; i++) {
    flag = 0;
    for (j = 2; j < sqrt(ary[i]); j++) {
      if (ary[i] % j == 0) {
        flag = 1;
      }
    }
    if (flag == 0) scount++;
  }
  printf("%d\n", scount);
  return 0;
}
