let id x = x
let n = Scanf.scanf "%d\n" id
  
let repeat f =
  let rec loop acc = function
    | 0 -> List.rev acc
    | n -> loop (f () :: acc) (n-1) in
  loop []

let alist = repeat (fun () -> Scanf.scanf "%d " id) n
let len = List.length alist

let rec del_i i l =
  match l with
  | [] -> []
  | h::t when i = 0 -> t
  | h::t -> h :: del_i (i-1) t


let rec del x l =
  match l with
  | [] -> []
  | h::t when h = x -> t
  | h::t -> h :: del x t

  
let check' alist =
  let rec check1 i ans =
    if i = len then ans else check2 (del_i i alist) (List.nth alist i) ans i

  and check2 alist' x ans i =
    match alist' with
    | [] -> check1 (i+1) (ans+1)
    | alist' ->
       if List.exists (fun y -> y <= 2*x) alist' then
	let x' = (List.find (fun y -> y <= 2*x) alist') in
	check2 (del x' alist') (x + x') ans i
       else check1 (i+1) ans
in check1 0 0

let ans = check' alist

let () = Printf.printf "%d\n" ans
