#include <bits/stdc++.h>
int main() {
  int i, n, c = 0;
  long j, v, w[4] = {2, 3, 5, 7};
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%ld", &v);
    if (v == 2l || v == 3l || v == 5l || v == 7l) {
      c++;
      continue;
    }
    for (j = 11l; j <= v; j++) {
      if (j % 2l == 0) continue;
      if (j % 3l == 0) continue;
      if (j % 5l == 0) continue;
      if (j % 7l == 0) continue;
      if (v % j == 0) {
        break;
      }
    }
    if (v == j) c++;
  }
  printf("%d\n", c);
  return 0;
}
