local n=io.read("n")
local a={}
local asum=0
for i=1,n do
    a[i]=io.read("n")
    asum=asum+a[i]
end
local b={}
local bsum=0
local minusb={}
local plusa=0
local counter=0
local flag=true
for i=1,n do
    b[i]=io.read("n")
    bsum=bsum+b[i]
    if a[i]>b[i] then
        table.insert(minusb,a[i]-b[i])
        flag=false
    elseif a[i]<b[i] then
        plusa=plusa+b[i]-a[i]
        counter=counter+1
    end
end
table.sort(minusb)

if bsum>asum then
    print(-1)
else
    for i=#minusb,1,-1 do
        if plusa>0 then
            plusa=plusa-minusb[i]
            counter=counter+1
        else
            break
        end
    end
    print(flag and 0 or counter)
end