#include <bits/stdc++.h>
int main() {
  int n;
  scanf("%d", &n);
  int i, j, k, a[n], count = 0;
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  for (i = 0; i < n; i++) {
    if ((a[i] == 2) || (a[i] == 3) || (a[i] == 5) || (a[i] == 7) ||
        (a[i] == 11) || (a[i] == 13) || (a[i] == 17) || (a[i] == 19) ||
        (a[i] == 23) || (a[i] == 29) || (a[i] == 31) || (a[i] == 37) ||
        (a[i] == 41) || (a[i] == 43) || (a[i] == 47) || (a[i] == 53) ||
        (a[i] == 59) || (a[i] == 61) || (a[i] == 67)) {
      count++;
      continue;
    }
    if (i < 71) {
      continue;
    }
    for (j = 2; j <= ((i / 2) + 1); j++) {
      if (a[i] % j == 0) {
        break;
      }
      if (j == ((i / 2) + 1)) {
        count++;
      }
    }
  }
  printf("%d\n", count);
}
