# keyence2019C - Exam and Wizard

def main():

    N = int(eval(input()))

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

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

    dif = sorted(i - j for i, j in zip(A, B))

    ans, shortage = 0, 0

    for i in dif:

        if i < 0:

            ans += 1

            shortage += i

        else:

            break

    for i in dif[::-1]:

        if shortage >= 0:

            print(ans)

            return

        ans += 1

        shortage += i

    print((-1))





if __name__ == "__main__":

    main()
# keyence2019C - Exam and Wizard

def main():

    N = int(eval(input()))

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

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

    pos, neg = [], []

    for i, j in zip(A, B):

        x = i - j

        if x >= 0:

            pos += [x]

        else:

            neg += [x]

    ans, shortage = len(neg), sum(neg)

    for i in sorted(pos, reverse=1):

        if shortage >= 0:

            print(ans)

            return

        ans += 1

        shortage += i

    print((ans if shortage >= 0 else -1))





if __name__ == "__main__":

    main()
# keyence2019C - Exam and Wizard
def main():
    N = int(eval(input()))
    A = tuple(map(int, input().split()))
    B = tuple(map(int, input().split()))
    dif = sorted(i - j for i, j in zip(A, B))
    ans, shortage = 0, 0
    for i in dif:
        if i < 0:
            ans += 1
            shortage += i
        else:
            break
    for i in dif[::-1]:
        if shortage >= 0:
            print(ans)
            return
        ans += 1
        shortage += i
    print((-1))


if __name__ == "__main__":
    main()

# keyence2019C - Exam and Wizard
def main():
    N = int(eval(input()))
    A = tuple(map(int, input().split()))
    B = tuple(map(int, input().split()))
    pos, neg = [], []
    for i, j in zip(A, B):
        x = i - j
        if x >= 0:
            pos += [x]
        else:
            neg += [x]
    ans, shortage = len(neg), sum(neg)
    for i in sorted(pos, reverse=1):
        if shortage >= 0:
            print(ans)
            return
        ans += 1
        shortage += i
    print((ans if shortage >= 0 else -1))


if __name__ == "__main__":
    main()

-    dif = sorted(i - j for i, j in zip(A, B)) -    ans, shortage = 0, 0 -    for i in dif: -        if i < 0: -            ans += 1 -            shortage += i +    pos, neg = [], [] +    for i, j in zip(A, B): +        x = i - j +        if x >= 0: +            pos += [x] -            break -    for i in dif[::-1]: +            neg += [x] +    ans, shortage = len(neg), sum(neg) +    for i in sorted(pos, reverse=1): -    print((-1)) +    print((ans if shortage >= 0 else -1))