program name
    use,intrinsic :: iso_fortran_env
    implicit none
    integer(int64):: n,i,j,ans,msum,psum
    integer(int64), allocatable:: a(:),b(:),d(:)
    
    read*, n
    allocate(a(n),b(n),d(n))
    read*, a(:)
    read*, b(:)
    d(:) = a(:) - b(:)

    if (sum(d) < 0) then
        print'(i0)', -1
        stop
    end if

    ans=0
    msum=0
    do i=1,n
        if (d(i) < 0) then
            ans=ans+1
            msum=msum-d(i)
        end if
    end do
    if (msum == 0) then
        print'(i0)', 0
        stop
    end if

    call merge_sort(d,1_8,n)

    psum=0
    do i=1,n
        psum=psum+d(i)
        if (psum >= msum) then
            print'(i0)', i+ans
            stop
        end if
    end do



contains
    recursive subroutine merge_sort(ar, fst, lst)
        integer(int64),intent(inout):: ar(:)
        integer(int64),intent(in):: fst,lst
        integer(int64):: mdl

        if (lst-fst < 2) then
            if (ar(fst) < ar(lst)) call swap(ar(fst),ar(lst))
            return
        end if

        mdl = (fst+lst)/2
        call merge_sort(ar, fst, mdl)
        call merge_sort(ar, mdl+1, lst)
        call merge_(ar, fst, mdl, lst)
    end subroutine

    subroutine merge_(ar, fst, mdl, lst)
        integer(int64),intent(inout):: ar(:)
        integer(int64),intent(in):: fst, mdl, lst
        integer(int64),allocatable:: tmp(:)
        integer(int64):: li, ri, ti

        allocate(tmp(lst-fst+1))

        li=fst
        ri=mdl+1   
        ti=1

        do while (li <= mdl .and. ri <= lst)
            if (ar(li) >= ar(ri)) then
                tmp(ti) = ar(li)
                li=li+1
            else
                tmp(ti) = ar(ri)
                ri=ri+1
            end if
            ti=ti+1
        end do

        if (li <= mdl) then
            tmp(ti:) = ar(li:mdl)
        else
            tmp(ti:) = ar(ri:lst)
        end if

        ar(fst:lst) = tmp(:)
        deallocate(tmp)
    end subroutine

    subroutine swap(x,y)
        integer(int64),intent(inout):: x,y
        integer(int64):: tmp
        tmp = x
        x = y
        y = tmp
    end subroutine
end program name