Scanf.scanf "%d" @@ fun n ->
  let a = Array.init n (fun _ -> Scanf.scanf " %d" ((+) 0)) in
  Array.sort (fun x y -> y-x) a;
  let sa = Array.init n (fun i -> a.(i)) in
  for i = n-2 downto 0 do sa.(i) <- sa.(i) + sa.(i+1) done;
  Array.fold_left (fun (c, (ok, x)) y ->
    if ok && x-y <= 2*y then (c+1, (true, y)) else (c, (false, y))) (0, (true, 0)) sa
  |> fst |> Printf.printf "%d\n"