let n = Scanf.scanf "%d\n" (fun i -> i)
let a = Array.init n (fun _ -> Scanf.scanf " %d" (fun i -> i))

let m = Array.fold_left max 1 a + 1

let b1 = Array.make m false
let b2 = Array.make m false


let rec f i =
  if i < n then (
    let ai = a.(i) in
    if not b1.(ai) then (
        if b2.(ai) then
          b1.(ai) <- true
        else (
          let rec g j =
            let x = ai * j in
            if x < m then (
                b1.(x) <- true;
                g (j + 1)
            ) in
          g 2;
          b2.(ai) <- true
        )
    );
    f (i + 1)
  )

let rec g i ans =
  if i = n then ans
  else if b1.(a.(i)) then g (i + 1) ans
  else g (i + 1) (ans + 1)

let () = f 0; Printf.printf "%d\n" (g 0 0)
