fun main(args : Array<String>) {
    val n = readLine()!!.toInt()
    val aa = readLine()!!.split(" ").map { it.toInt() }
    val bb = readLine()!!.split(" ").map { it.toInt() }
    val diff = mutableListOf<Diff>()

    for (i in 0 until n) {
        diff.add(Diff(i, (aa[i]-bb[i]).toLong()))
    }

    var ans = diff.count { it.diff < 0L }

    if (ans == 0) {
        println(0)
        return
    }

    var negSum = diff.fold(0L) { acc, diff ->
        if (diff.diff < 0L) acc + diff.diff else acc
    }

    val pos = diff.filter { it.diff > 0 }.sortedByDescending { it.diff }

    for (i in pos.indices) {
        ans++
        negSum += pos[i].diff
        if (negSum >= 0) {
            println(ans)
            return
        }
    }

    println(-1)
}

data class Diff(val idx: Int, val diff: Long)