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