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