program main
implicit None
integer(8)::n,p,q,i
integer(8),allocatable::a(:),b(:)
	
	read*,n
	allocate(a(n),b(n))
	read*,a
	read*,b
	
	a = a-b
	
	if(sum(a) < 0)then
		print 101,-1
		stop
	endif
	
	call h2(a,n)
	
	p = 0
	q = 0
	do i = 1,n
		if(a(i) >= 0)then
			p = i-1
			exit
		endif
		q = q + a(i)
	enddo
	
	do i = n,1,-1
		q = q + a(i)
		p = p + 1
		if(q >= 0)then
			exit
		endif
	enddo
	
	print 101,p
	
101 format(i0)
end program main

subroutine h2(a,n)
implicit None
	integer(8)::a(n),x
	integer(8)::n,i,ie,i0,i1,i2
	
	do i = n/2,1,-1
		x = a(i);ie = n + 1; i0 = i; i1 = i0 * 2
		do while(i1 < ie)
			i2 = i1 + 1
			if(i2 < ie .and. a(i1) < a(i2)) i1 = i2
			if(a(i1) > x)then
				a(i0) = a(i1);a(i1) = x
				else
				exit
			endif
			i0 = i1;i1 = i0 *2
		enddo
	enddo
	do ie = n,2,-1
		x = a(ie)
		a(ie) = a(1)
		a(1) = x
		i0 =1;i1 =2
		do while(i1 <ie)
			i2 = i1 +1
			if(i2 < ie .and. a(i1) < a(i2)) i1 = i2
			if(a(i1) > x)then
				a(i0) = a(i1);a(i1) = x
				else
				exit
			endif
			i0 = i1;i1 = i0 *2
		enddo
	enddo
end subroutine h2