let () = Scanf.scanf "%d\n" @@ fun n ->
  let cnt = Array.make 1000001 0 in
  for i=1 to n do
    Scanf.scanf " %d" @@ fun a -> cnt.(a) <- 1 + cnt.(a)
  done;
  let dp = Array.make 1000001 1 in
  for a=0 to 1000000 do
    if cnt.(a) <> 1 then dp.(a) <- 0;
    if 0 < cnt.(a) then
      let rec mark i =
        if i <= 1000000 then
          (cnt.(i) <- 0; mark (i+a)) in
      mark (a)
  done;
  Printf.printf "%d\n" @@ Array.fold_left (+) 0 dp