fun main(args: Array<String>){
    val n = Integer.parseInt(readLine())
    val aInput: List<String> = readLine()!!.split(" ")
    val bInput: List<String> = readLine()!!.split(" ")
    val aList = aInput.map { it.toLong() }
    val bList = bInput.map { it.toLong() }
    var shortage = 0L
    var excess = 0L
    var shortageNum = 0
    val excessList = mutableListOf<Long>()
    for(i in 0 until n){
        if(aList[i] < bList[i]){
            shortage += bList[i] - aList[i]
            shortageNum++
        }else if(aList[i] > bList[i]){
            excessList.add(aList[i] - bList[i])
            excess += aList[i] - bList[i]
        }
    }

    if(shortage == 0L){
        println(0)
        return
    }

    val sortedExcessList = excessList.sortedDescending()

    for((i, ex) in sortedExcessList.withIndex()){
        shortage -= ex
        if(shortage <= 0){
            println(i+1+shortageNum)
            return
        }
    }
    println(-1)
}