[<AutoOpen>]
module Program

open System

let read f = stdin.ReadLine() |> f
let reada f = stdin.ReadLine().Split() |> Array.map f
let reads f = stdin.ReadLine().Split() |> Array.toList |> List.map f

[<EntryPoint>]
let main _ =
    let N = read int64
    let bs = reads int64
    let cs = reads int64
    let (ds, es) =
        List.map2 (-) bs cs
        |> List.partition ((<=) 0L)
        |> fun (xs, ys) -> (List.sortDescending xs, List.sort ys)

    let dsScan = List.scan (+) 0L ds |> List.tail
    let esSum = List.sum es

    let (fs, gs) = List.partition ((<) -esSum) dsScan
    let ans1 = List.length gs + 1
    let ans2 = List.length es

    match es, fs with
    | [], _ -> printfn "0"
    | _, [] -> printfn "-1"
    | _ -> printfn "%i" (ans1 + ans2)

    0