module Sort_Module
    implicit none
    public
    contains
    recursive subroutine mergesort(a, p, r, b)
        integer(8) a(:), b(:)
        integer(8) p, r
        integer(8) q
        if (p < r) then
            q = (p+r)/2
            call mergesort(a, p, q, b)
            call mergesort(a, q+1, r, b)
            call merge(a, p, q, r, b)
        end if
    end subroutine mergesort
    subroutine merge(a, p, q, r, b)
        integer(8) a(:), b(:)
        integer(8) p, r, q, i, j, k
        integer(8) t
        k = p;   i = p;   j = q+1
        do
            if (.not. (k <= r)) exit
            if (j > r) then
                t = a(i);   i = i+1
            else if (i > q) then
                t = a(j);   j = j+1
            else if (a(i) <= a(j)) then
                t = a(i);   i = i+1
            else
                t = a(j);   j = j+1
            end if
            b(k) = t;   k = k+1
        end do
        do i = p, r
            a(i) = b(i)  
        end do
    end subroutine merge
    subroutine sort(a)
      integer(8) a(:),b(ubound(a,1)-size(a)+1:ubound(a,1)),n,k
      n = ubound(a,1)
      k = ubound(a,1)-size(a)+1
      call mergesort(a,k,n,b)
    end subroutine sort
    function POSL(a,v) result(r)!find first i:a(i)>=v
        implicit none
        integer(8) :: a(:),l,r,idx,v
        r = ubound(a,1) + 1
        l = ubound(a,1)-size(a)
        do while(r-l>1)
            idx = l + (r-l)/2
            if(a(idx) >= v)then
                r = idx
            else
                l = idx
            endif
        enddo
    end function
    function POSU(a,v) result(r)!find first i:a(i)>v
        implicit none
        integer(8) :: a(:),l,r,idx,v
        r = ubound(a,1) + 1
        l = ubound(a,1)-size(a)
        do while(r-l>1)
            idx = l + (r-l)/2
            if(a(idx) > v)then
                r = idx
            else
                l = idx
            endif
        enddo
    end function
    function NUM(a,v) result(n)
        implicit none
        integer(8) :: a(:),v,n
        n = POSU(a,v) - POSL(a,v)
    end function
end module Sort_Module



program atcoder
    use Sort_Module
    implicit none
    integer(8) :: N,M,i,ans,k,l,x,y,z,MO,j
    integer(8),allocatable,dimension(:) :: A,B,C,Csum
    MO = 1000000007_8
    read*,N
    allocate(A(N),B(N),C(N),Csum(N))
    read(*,*)(A(i),i=1,N)
    read(*,*)(B(i),i=1,N)
    do i=1,N
        C(i) = A(i)-B(i)
    enddo
    if(sum(A)<sum(B))then
        write(*,'(I0)')-1
        return 
    endif
    call sort(C)
    Csum(1) = C(1)
    do i = 2,N
        Csum(i) = Csum(i-1) + C(i)
    enddo

    k = 0
    i = 1
    do while(C(i)<0)
        k = k + C(i)
        i = i + 1
    enddo
    do j = 0,N-1
        l = Csum(N) - Csum(N-j)
        if(l+k>=0)then
            write(*,'(I0)')j+i-1
            return
        endif
    enddo

    stop 
contains
end program atcoder