program exam
  implicit none
  integer :: n, c, i
  integer(8),allocatable :: a(:), b(:), p(:)
  integer(8) :: pmax, d, y
  read(*,*) n
  allocate(a(n), b(n), p(n))
  read(*,*) a
  read(*,*) b
  if (sum(a) < sum(b)) then
     write(*,*) -1
     stop
  end if

  p = a - b
  c = 0

  do i = 1, n
     if (p(i) < 0) then
        c = c + 1
        d = d + abs(p(i))
     end if
  end do

  if (c == 0) then
     write(*,*) 0
     stop
  end if

  call heapsort(p)

  do i = n, 1, -1
     c = c + 1
     d = d - p(i)
     if (d <= 0) then
        exit
     end if
  end do
  write(*,*) c

  stop

contains
  
  subroutine heapsort(array)
    implicit none
    integer(8):: array(:)
    integer ::i,k,j,l
    integer(8) :: t

    n=size(array)

    if (n==1) then
       return
    end if
    
    l=n/2+1
    k=n
    do while(k.ne.1)
       if(l.gt.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.le.k)
          if(j.lt.k)then
             if(array(j).lt.array(j+1))j=j+1
          endif
          if (t.lt.array(j))then
             array(i)=array(j)
             i=j
             j=j+j
          else
             j=k+1
          endif
       end do
       array(i)=t
    end do
    return
  end subroutine heapsort

end program
