program sample
	implicit none
    integer(8) :: N,i,max1,j,count,minus
    integer(8),allocatable :: a(:),b(:),x(:),y(:)
   
    read(*,*) N
    
    allocate(a(N))
    allocate(b(N))
    allocate(x(N))
    allocate(y(N))
    
    read(*,*) a
    read(*,*) b
    
    count=0
    
	if ( sum(a)<sum(b) ) then
    	write(*,*) -1
	else
    	do i=1,N
			x(i) = a(i)-b(i)
        end do
        
        if (minval(x)>=0) then
        	write(*,*) 0
        else
        	do i=1,N
            	if (x(i)<0) then
                	count = count + 1
                    minus = minus + x(i)
                    !minusはxの配列の中でマイナスのものを足し合わせたもの。このマイナスを
                    !なるべく少ないプラスの数で0にしてあげれば良い。
        		end if
            end do
                !xの配列を大きい順に並べ替えたい
            call sortup(x,y)
            j=1
            do while(.true.)
            	minus = minus + y(j)
                count = count +1
                j = j+1
              	if (minus < 0) then
                	cycle
               	else
                   	exit
                end if
                
            end do
            write(*,*) count
        end if
	end if
    
    deallocate(a)
    deallocate(b)
    deallocate(x)
    
    stop
contains

	subroutine sortup(x,y)
    implicit none                 ! 暗黙の型宣言の禁止
    integer(8),intent(in) :: x(:)
    integer(8),intent(out) :: y(:)
    integer(8) :: i,j,N,a
    
    N = size(x)
    
        do i=1,N
    	y(i) = x(i)
    end do
    
    do i=1,N
    	do j=i,N
        	if( y(i) < y(j) ) then
            	a = y(i)
                y(i) = y(j)
                y(j) = a
            end if
        end do
    end do


  end subroutine sortup

end program sample