object Main extends App {

  import scala.io.StdIn._

  val n = readLine.trim.toInt
  val a = readLine.trim.split(' ').map(_.toLong)
  val b = readLine.trim.split(' ').map(_.toLong)
  if (a.sum >= b.sum){
    val diff = a.zip(b).map{case (a, b) ⇒ a - b}
    val minus = diff.filter(_ < 0)
    val sum = minus.sum
    val plus = diff.filter(_ > 0).sorted.reverse
    for (i ← plus.indices.tail) plus(i) += plus(i - 1)
    if (sum == 0) println(0)
    else println(minus.length + lowerBound(plus, -sum) + 1)
  }else {
    println(-1)
  }
  def lowerBound(array: Array[Long], target: Long): Int = {
    var left = 0
    var right = array.length
    while(left < right){
      val mid = (left + right) / 2
      if (array(mid) < target){
        left = mid + 1
      }else {
        right = mid
      }
    }
    right
  }
  implicit class Extension[T](value :T){
    @inline
    def let[A](@inline func: T ⇒ A): A = func(value)
    @inline
    def also(@inline func: T ⇒ Unit): T = {func(value); value}
  }
}