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 bsort(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 bsort(array)
    implicit none
    
    integer(8)::array(:)
    integer(8)::i, j, memory

    do i = 1, size(array) - 1
       do j = 1, size(array) - i
          if (array(j) > array(j+1)) then
             memory = array(j+1)
             array(j+1) = array(j)
             array(j) = memory
          end if
       end do
    end do
  end subroutine bsort
end program exam
