program exam
  implicit none

  integer(8) :: n, i, div, ans
  integer(8), allocatable :: a(:), b(:), d(:)

  read(*,*) n
  allocate(a(n))
  allocate(b(n))
  allocate(d(n))

  read(*,*) a
  read(*,*) b

  
  do i = 1, n
     d(i) = b(i) - a(i)
  end do

  if(sum(d) > 0) then
     ans = -1
  else
     ans = 0
     div = 0
     do i = 1, n
        if(d(i) > 0) then
           ans = ans + 1
           div = div + d(i)
        end if
     end do

     call heapsort(d)

     do i = 1, n
        if (div <= 0) then
           exit
        else
           div = div + d(i)
           ans = ans + 1
        end if

     end do
        
  end if
  
  write(*,*) ans

  deallocate(a, b, d)

  stop

contains
  subroutine heapsort(array)
  implicit none
  integer(8), intent(inout) :: array(:)
  
  integer(8) :: i,k,j,l
  double precision :: t
  
  if(n <= 0)then
     write(6,*)"Error, at heapsort"; stop
  endif
  if(n == 1)return

  l=n/2+1
  k=n
  do while(k /= 1)
     if(l > 1)then
        l=l-1
        t=array(L)
     else
        t=array(k)
        array(k)=array(1)
        k=k-1
        if(k == 1) then
           array(1)=t
           exit
        endif
     endif
     i=l
     j=l+l
     do while(j <= k)
        if(j < k)then
           if(array(j).lt.array(j+1))j=j+1
        endif
        if (t < array(j))then
           array(i)=array(j)
           i=j
           j=j+j
        else
           j=k+1
        endif
     enddo
     array(i)=t
  enddo

  return
end subroutine heapsort
  
end program exam

           
        
