let n = Scanf.scanf " %d" (+) 0
let a_s = Array.init n @@ fun _ -> Scanf.scanf " %d" (+) 0
let ds = Array.init n @@ fun i -> Scanf.scanf " %d" @@ fun b -> a_s.(i) - b
let sl, nl = Array.fold_left (fun (s, n) d -> if d < 0 then s + abs d, n + 1 else s, n) (0, 0) ds
let s = ref 0
let _ = if sl = 0 then print_endline "0" else Array.(sort (fun x y -> y - x) ds; iteri (fun i d -> if d > 0 then (s := !s + d; if !s >= sl then (Printf.printf "%d\n" @@ nl + i + 1; exit 0)) else (print_endline "-1"; exit 0)) ds)