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