object Main {
  def main(args: Array[String]): Unit = {
    val result = func()
    println(result)
  }

  def func() : Long = {
    val sc = new java.util.Scanner(System.in)
    val n = sc.nextInt
    val listA = List.fill(n)(sc.nextLong)
    val listB = List.fill(n)(sc.nextLong)
    val diff = listA.zip(listB).map(t => t._1 - t._2)
    if(diff.sum < 0){
      return -1
    }

    var ans = diff.count(_ < 0)
    val negativeSum : Long = diff.filter(_ < 0).sum
    val positiveList = diff.filter(_ > 0).sorted.reverseIterator


    var acc : Long = 0
    while(negativeSum + acc < 0){
      acc += positiveList.next
      ans += 1
    }

    ans
  }
}