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(a) < sum(b)) 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

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

        end do

     end do

  end if

  write(*,*) ans

  deallocate(a, b, d)

end program exam


           
        
