fun main(args: Array<String>) {
    keyence2019c()
}

fun keyence2019c() {
    val n = readLine()!!.toInt()
    val aList = readLine()!!.split(" ").map { it.toLong() }
    val bList = readLine()!!.split(" ").map { it.toLong() }

    if (aList.sum() < bList.sum()) return println(-1)

    val diffs = aList.withIndex().map { it.value - bList[it.index] }.sortedDescending()
    val negativeDiffs = diffs.filter { it < 0 }

    var negativeDiffSum = negativeDiffs.sum()
    var needChangePositives = 0
    while (negativeDiffSum < 0) {
        negativeDiffSum += diffs[needChangePositives++]
    }

    val answer = negativeDiffs.size + needChangePositives

    println(answer)
}
