#include <bits/stdc++.h>
void judgment(int *, int);
int main() {
  int C[10000], i, k, judge;
  scanf("%d", &k);
  for (i = 0; i < k; i++) scanf("%d", &C[i]);
  judgment(C, k);
  return 0;
}
void judgment(int *c, int n) {
  int i, j, max = 0, cnt = 0, flag = 0;
  double num;
  for (i = 0; i < n; i++) {
    if (*(c + i) > max) {
      max = *(c + i);
    }
  }
  for (i = 2; i <= max; i++) {
    if (i == 2) {
      cnt++;
      continue;
    } else if (i % 2 == 0)
      continue;
    num = sqrt(i);
    for (j = 3; j <= num; j += 2) {
      if (i % j == 0) {
        flag = 1;
        break;
      }
    }
    if (flag == 0) cnt++;
    flag = 0;
  }
  printf("%d\n", cnt);
}
