from collections import Counter,defaultdict,deque

import sys,heapq,bisect,math,itertools,string,queue

sys.setrecursionlimit(10**8)

mod = 10**9+7

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))

def inpl_str(): return list(sys.stdin.readline().split())

def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))



n = inp()

a = inpl()

b = inpl()

dif = sum(a) - sum(b)

if dif < 0:

    print((-1))

else:

    m_cnt = 0

    m_num = 0

    p = []

    for i in range(n):

        if a[i] - b[i] > 0:

            p.append(a[i] - b[i])

        elif a[i] - b[i] < 0:

            m_cnt += 1

            m_num += b[i] - a[i]

    cnt = 0

    p.sort()

    while m_num > 0:

        cnt += 1

        tmp = p.pop()

        m_num -= tmp

    print((m_cnt + cnt))
from collections import Counter,defaultdict,deque

from heapq import heappop,heappush

from bisect import bisect_left,bisect_right 

import sys,math,itertools,fractions,pprint

sys.setrecursionlimit(10**8)

mod = 10**9+7

INF = float('inf')

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))



n = inp()

a = inpl()

b = inpl()

p = []

m = 0

c = 0

for i in range(n):

    if a[i] - b[i] < 0:

        m += b[i]-a[i]

        c += 1

    elif a[i]-b[i] > 0:

        p.append(a[i] - b[i])

p.sort(reverse = True)

if m > sum(p):

    print((-1))

    quit()

for x in p:

    if m <= 0:

        break

    c += 1

    m -= x

print(c)



from collections import Counter, defaultdict, deque
import sys, heapq, bisect, math, itertools, string, queue

sys.setrecursionlimit(10**8)
mod = 10**9 + 7


def inp():
    return int(sys.stdin.readline())


def inpl():
    return list(map(int, sys.stdin.readline().split()))


def inpl_str():
    return list(sys.stdin.readline().split())


def inpln(n):
    return list(int(sys.stdin.readline()) for i in range(n))


n = inp()
a = inpl()
b = inpl()
dif = sum(a) - sum(b)
if dif < 0:
    print((-1))
else:
    m_cnt = 0
    m_num = 0
    p = []
    for i in range(n):
        if a[i] - b[i] > 0:
            p.append(a[i] - b[i])
        elif a[i] - b[i] < 0:
            m_cnt += 1
            m_num += b[i] - a[i]
    cnt = 0
    p.sort()
    while m_num > 0:
        cnt += 1
        tmp = p.pop()
        m_num -= tmp
    print((m_cnt + cnt))

from collections import Counter, defaultdict, deque
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right
import sys, math, itertools, fractions, pprint

sys.setrecursionlimit(10**8)
mod = 10**9 + 7
INF = float("inf")


def inp():
    return int(sys.stdin.readline())


def inpl():
    return list(map(int, sys.stdin.readline().split()))


n = inp()
a = inpl()
b = inpl()
p = []
m = 0
c = 0
for i in range(n):
    if a[i] - b[i] < 0:
        m += b[i] - a[i]
        c += 1
    elif a[i] - b[i] > 0:
        p.append(a[i] - b[i])
p.sort(reverse=True)
if m > sum(p):
    print((-1))
    quit()
for x in p:
    if m <= 0:
        break
    c += 1
    m -= x
print(c)

-import sys, heapq, bisect, math, itertools, string, queue +from heapq import heappop, heappush +from bisect import bisect_left, bisect_right +import sys, math, itertools, fractions, pprint +INF = float("inf") -def inpl_str(): -    return list(sys.stdin.readline().split()) - - -def inpln(n): -    return list(int(sys.stdin.readline()) for i in range(n)) - - -dif = sum(a) - sum(b) -if dif < 0: +p = [] +m = 0 +c = 0 +for i in range(n): +    if a[i] - b[i] < 0: +        m += b[i] - a[i] +        c += 1 +    elif a[i] - b[i] > 0: +        p.append(a[i] - b[i]) +p.sort(reverse=True) +if m > sum(p): -else: -    m_cnt = 0 -    m_num = 0 -    p = [] -    for i in range(n): -        if a[i] - b[i] > 0: -            p.append(a[i] - b[i]) -        elif a[i] - b[i] < 0: -            m_cnt += 1 -            m_num += b[i] - a[i] -    cnt = 0 -    p.sort() -    while m_num > 0: -        cnt += 1 -        tmp = p.pop() -        m_num -= tmp -    print((m_cnt + cnt)) +    quit() +for x in p: +    if m <= 0: +        break +    c += 1 +    m -= x +print(c)