import sys

def input(): return sys.stdin.readline().strip()

def mapint(): return list(map(int, input().split()))

sys.setrecursionlimit(10**9)



N = int(eval(input()))

As = list(mapint())

Bs = list(mapint())



if sum(As)<sum(Bs):

    print((-1))

else:

    diff = [a-b for a, b in zip(As, Bs)]

    diff.sort()

    cnt = 0

    need = 0

    for d in diff:

        if d>=0:

            break

        need += d

        cnt += 1

    for d in diff[::-1]:

        if need>=0:

            break

        need += d

        cnt += 1

    print(cnt)
import sys

def input(): return sys.stdin.readline().strip()

def mapint(): return list(map(int, input().split()))

sys.setrecursionlimit(10**9)



N = int(eval(input()))

As = list(mapint())

Bs = list(mapint())



if sum(As)<sum(Bs):

    print((-1))

else:

    minus = 0

    cnt = 0

    lis = []

    for a, b in zip(As, Bs):

        if a<b:

            minus += (b-a)

            cnt += 1

        else:

            lis.append(a-b)

    lis.sort(reverse=True)

    if minus==0:

        print((0))

    else:

        for l in lis:

            minus -= l

            cnt += 1

            if minus<=0:

                break

        print(cnt)
import sys


def input():
    return sys.stdin.readline().strip()


def mapint():
    return list(map(int, input().split()))


sys.setrecursionlimit(10**9)
N = int(eval(input()))
As = list(mapint())
Bs = list(mapint())
if sum(As) < sum(Bs):
    print((-1))
else:
    diff = [a - b for a, b in zip(As, Bs)]
    diff.sort()
    cnt = 0
    need = 0
    for d in diff:
        if d >= 0:
            break
        need += d
        cnt += 1
    for d in diff[::-1]:
        if need >= 0:
            break
        need += d
        cnt += 1
    print(cnt)

import sys


def input():
    return sys.stdin.readline().strip()


def mapint():
    return list(map(int, input().split()))


sys.setrecursionlimit(10**9)
N = int(eval(input()))
As = list(mapint())
Bs = list(mapint())
if sum(As) < sum(Bs):
    print((-1))
else:
    minus = 0
    cnt = 0
    lis = []
    for a, b in zip(As, Bs):
        if a < b:
            minus += b - a
            cnt += 1
        else:
            lis.append(a - b)
    lis.sort(reverse=True)
    if minus == 0:
        print((0))
    else:
        for l in lis:
            minus -= l
            cnt += 1
            if minus <= 0:
                break
        print(cnt)

-    diff = [a - b for a, b in zip(As, Bs)] -    diff.sort() +    minus = 0 -    need = 0 -    for d in diff: -        if d >= 0: -            break -        need += d -        cnt += 1 -    for d in diff[::-1]: -        if need >= 0: -            break -        need += d -        cnt += 1 -    print(cnt) +    lis = [] +    for a, b in zip(As, Bs): +        if a < b: +            minus += b - a +            cnt += 1 +        else: +            lis.append(a - b) +    lis.sort(reverse=True) +    if minus == 0: +        print((0)) +    else: +        for l in lis: +            minus -= l +            cnt += 1 +            if minus <= 0: +                break +        print(cnt)