Scanf.scanf "%d" (fun n ->
    let a = Array.init n (fun _ -> Scanf.scanf " %d" (fun a -> a)) in
    Array.sort compare a;
    let asm = Array.make n 0 in
    asm.(0) <- a.(0);
    for i = 1 to n - 1 do
        asm.(i) <- asm.(i - 1) + a.(i)
    done;
    let rec loop i =
        if i < 0 then n else
            if asm.(i) * 2 >= a.(i + 1) then loop (i - 1) else n - i - 1
    in
    loop (n - 2) |> Printf.printf "%d\n"
)