A university student, Takahashi, has to take N examinations and pass all of them. Currently, his _readiness_ for the i-th examination is A_{i}, and according to his investigation, it is known that he needs readiness of at least B_{i} in order to pass the i-th examination.  Takahashi thinks that he may not be able to pass all the examinations, and he has decided to ask a magician, Aoki, to change the readiness for as few examinations as possible so that he can pass all of them, while not changing the total readiness.  For Takahashi, find the minimum possible number of indices i such that A_i and C_i are different, for a sequence C_1, C_2, ..., C_{N} that satisfies the following conditions:    * The sum of the sequence A_1, A_2, ..., A_{N} and the sum of the sequence C_1, C_2, ..., C_{N} are equal.   * For every i, B_i \leq C_i holds.  If such a sequence C_1, C_2, ..., C_{N} cannot be constructed, print -1.
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
D = sorted(a - b for a, b in zip(A, B))

def f():
    i, j = 0, len(D) - 1
    p = 0
    ans = 0
    print(D)
    while j >= i:
        # print(i, j, D[i], D[j], p)
        if D[i] >= 0:
            return ans
        if p >= -D[i]:
            p += D[i]
            i += 1
            ans += 1
            continue
        p += D[j]
        j -= 1
        ans += 1
    if p >= 0:
        return ans
    return -1

print(f())

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
D = sorted(a - b for a, b in zip(A, B))

def f():
    i, j = 0, len(D) - 1
    p = 0
    ans = 0
    #print(D)
    while j >= i:
        # print(i, j, D[i], D[j], p)
        if D[i] >= 0:
            return ans
        if p >= -D[i]:
            p += D[i]
            i += 1
            ans += 1
            continue
        p += D[j]
        j -= 1
        ans += 1
    if p >= 0:
        return ans
    return -1

print(f())

            
        
