#include <bits/stdc++.h>
int main(void) {
  int n, i, j, cnt = 0;
  double b;
  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 || x[j] % 2 == 0) j++;
    b = sqrt(x[j]);
    while (j <= b) {
      if (x[j] % j == 0) j = j + 2;
    }
    cnt = cnt + 1;
  }
  printf("%d", cnt);
  return 0;
}
