

let () = Scanf.scanf "%d\n" @@ fun n -> 
  let array = Array.init n @@ fun _ -> Scanf.scanf " %d" Fun.id in
  let () = Array.sort compare array in
  let dp = Array.make 1000010 true in
  let amax = 1000000 in
  let ans = ref 0 in
  for i=0 to n-1 do
    let a = array.(i) in
    let k = amax/a in
    if dp.(a)
    then
      begin
        if (i=0 || i>0 && array.(i-1) <> a) && (i=n-1 || i<n-1 && array.(i+1) <> a) then ans := !ans + 1
      end;
      for j=1 to k do
        dp.(a*j) <- false
      done
  done;
  Printf.printf "%d\n" !ans