import bisect

N = int(eval(input()))

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

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

C = sorted([A[i] - B[i] for i in range(N)])

if sum(C) < 0:

    print((-1))

elif min(C) >= 0:

    print((0))

else:

    D = sorted([i for i in C if i > 0], reverse=True)

    r = [D[0]]

    for i in range(len(D)-1):

        r.append(r[i] + D[i+1])

    print((len([i for i in C if i < 0])+bisect.bisect_left(r, sum(-i for i in C if i < 0))+1))

import bisect

N = int(eval(input()))

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

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

C = sorted([A[i] - B[i] for i in range(N)])

if sum(C) < 0:

    print((-1))

elif min(C) >= 0:

    print((0))

else:

    D = [i for i in C if i < 0]

    m = sum(D)

    for i in range(N-1,-1,-1):

        m += C[i]

        if m >= 0:

            print((len(D)-i+N))

            break

import bisect

N = int(eval(input()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = sorted([A[i] - B[i] for i in range(N)])
if sum(C) < 0:
    print((-1))
elif min(C) >= 0:
    print((0))
else:
    D = sorted([i for i in C if i > 0], reverse=True)
    r = [D[0]]
    for i in range(len(D) - 1):
        r.append(r[i] + D[i + 1])
    print(
        (
            len([i for i in C if i < 0])
            + bisect.bisect_left(r, sum(-i for i in C if i < 0))
            + 1
        )
    )

import bisect

N = int(eval(input()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = sorted([A[i] - B[i] for i in range(N)])
if sum(C) < 0:
    print((-1))
elif min(C) >= 0:
    print((0))
else:
    D = [i for i in C if i < 0]
    m = sum(D)
    for i in range(N - 1, -1, -1):
        m += C[i]
        if m >= 0:
            print((len(D) - i + N))
            break

-    D = sorted([i for i in C if i > 0], reverse=True) -    r = [D[0]] -    for i in range(len(D) - 1): -        r.append(r[i] + D[i + 1]) -    print( -        ( -            len([i for i in C if i < 0]) -            + bisect.bisect_left(r, sum(-i for i in C if i < 0)) -            + 1 -        ) -    ) +    D = [i for i in C if i < 0] +    m = sum(D) +    for i in range(N - 1, -1, -1): +        m += C[i] +        if m >= 0: +            print((len(D) - i + N)) +            break