n=int(eval(input()))

a=list(map(int,input().split()))

b=list(map(int,input().split()))

l=[]

m=[]

ans=0

for x,y in zip(a,b):

    if x-y>=0:

        l+=[x-y]

    else:

        m+=[x-y]

        ans+=1



if ans==0:

    print((0))

    exit()

l=sorted(l,reverse=True)

msum=sum(m)

if sum(m)+sum(l)<0:

    print((-1))

    exit()



for i in l:

    msum+=i

    ans+=1

    if msum>=0:

        print(ans)

        exit()

n=int(eval(input()))

a=list(map(int,input().split()))

b=list(map(int,input().split()))

if sum(a)<sum(b):

    print((-1))

    exit()

dif_posi=[]

dif_nega=0

cnt=0

for x,y in zip(a,b):

    if x-y<0:

        dif_nega+=x-y

        cnt+=1

    else:

        dif_posi.append(x-y)



dif_posi=sorted(dif_posi,reverse=True)

for i in dif_posi:

    if dif_nega >= 0:

        break

    dif_nega+=i

    cnt+=1



print(cnt)
n = int(eval(input()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
l = []
m = []
ans = 0
for x, y in zip(a, b):
    if x - y >= 0:
        l += [x - y]
    else:
        m += [x - y]
        ans += 1
if ans == 0:
    print((0))
    exit()
l = sorted(l, reverse=True)
msum = sum(m)
if sum(m) + sum(l) < 0:
    print((-1))
    exit()
for i in l:
    msum += i
    ans += 1
    if msum >= 0:
        print(ans)
        exit()

n = int(eval(input()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
if sum(a) < sum(b):
    print((-1))
    exit()
dif_posi = []
dif_nega = 0
cnt = 0
for x, y in zip(a, b):
    if x - y < 0:
        dif_nega += x - y
        cnt += 1
    else:
        dif_posi.append(x - y)
dif_posi = sorted(dif_posi, reverse=True)
for i in dif_posi:
    if dif_nega >= 0:
        break
    dif_nega += i
    cnt += 1
print(cnt)

-l = [] -m = [] -ans = 0 -for x, y in zip(a, b): -    if x - y >= 0: -        l += [x - y] -    else: -        m += [x - y] -        ans += 1 -if ans == 0: -    print((0)) -    exit() -l = sorted(l, reverse=True) -msum = sum(m) -if sum(m) + sum(l) < 0: +if sum(a) < sum(b): -for i in l: -    msum += i -    ans += 1 -    if msum >= 0: -        print(ans) -        exit() +dif_posi = [] +dif_nega = 0 +cnt = 0 +for x, y in zip(a, b): +    if x - y < 0: +        dif_nega += x - y +        cnt += 1 +    else: +        dif_posi.append(x - y) +dif_posi = sorted(dif_posi, reverse=True) +for i in dif_posi: +    if dif_nega >= 0: +        break +    dif_nega += i +    cnt += 1 +print(cnt)