#include <stdio.h>

int main(void) {

  long n;
  scanf("%ld", &n);
  long size = 1000000;
  long list[size+1];
  for (long i = 0; i <= size; i++) {
    list[i] = 0;
  }
  long a;
  for (long i = 0; i < n; i++) {
    scanf("%ld", &a);
    list[a]++;
  }
  long count = 0;
  for (long i = 0; i <= size; i++) {
    if (list[i] != 0) {
      for (long j = 2; i*j <= size; j++) {
        list[i*j] = 0;
      }
      if (list[i] == 1) {
        count++;
      }
    }
  }
  printf("%ld\n", count);

  return 0;
}