fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val aList = readLine()!!.split(" ").map(String::toLong)
    val bList = readLine()!!.split(" ").map(String::toLong)

    if (aList.sum() < bList.sum()) {
        print(-1)
        return
    }

    val diffList = (0 until n).map {aList[it] - bList[it]}.sortedDescending()
    val minusDiffList = diffList.filter { it < 0 }
    val minusCount = minusDiffList.size
    if (minusCount == 0) {
        print(0)
        return
    }
    val minusSum = minusDiffList.sum()
    var plusCurrentSum = 0L
    for (i in 0..diffList.size) {
        plusCurrentSum += diffList[i]
        if (plusCurrentSum >= -minusSum) {
            print(minusCount + i + 1)
            return
        }
    }
}