program main
implicit none
integer  (8)                             :: N, count, M, i, j, JG, aa, bb
integer(8), allocatable, dimension ( : ) :: A, B, D, tmp

read *,N
allocate ( A ( N ) )
allocate ( B ( N ) )
allocate ( D ( N ) )
allocate ( tmp ( N ) )
read *, A
read *, B

count = 0
JG = 0
M = 0

do i = 1, N
JG = JG + A ( i ) - B ( i )
end do

if ( JG < 0 ) then
print *,-1
stop
end if

do i = 1, N
D ( i ) = A ( i ) - B ( i )
if ( D ( i ) < 0 )  then
M = M + D ( i )
count = count + 1
end if
end do

do j = 1, N
do i = 1, N
if ( D ( i ) < D ( i + 1 ) ) then
tmp ( i ) = D ( i )
D ( i ) = D ( i + 1 )
D ( i + 1 ) = tmp ( i )
end if
end do
end do

do i = 1, N
if ( M >= 0 ) exit
M = M + D ( i )
count = count + 1
end do

print *, count

end program main
