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


     if (div > 0) then
       do i = 1, n
          if(d(i) == minval(d)) then
             div = div + d(i)
             d(i) = 0
             ans = ans + 1
             if(div > 0) then
                exit
             end if
          end if
       end do
    end if
    
        
  end if
  
  write(*,*) ans

  deallocate(a, b, d)

  stop

end program exam


           
        
