#include <bits/stdc++.h>
int arr[10001];
int main(void) {
  int max = 2, i, j, k, n, num, cnt = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &num);
    if (max < num) {
      for (j = max; j < num; j++) {
        if (arr[j]) continue;
        for (k = 2; j * k < 10001; k++) {
          arr[j * k] = 1;
        }
      }
      max = num;
    }
    if (!arr[num]) cnt++;
  }
  printf("%d\n", cnt);
}
