import scala.collection.mutable
import scala.io.StdIn._



object Main extends App {
  val n = readInt()
  val queue = mutable.PriorityQueue[Bacteria]()(Ordering.by[Bacteria, Long](_.in).reverse)
  val bacterias = Array.tabulate(n){_ ⇒
    val Array(a, b) = readLine.trim.split(' ').map(_.toLong)
    Bacteria(a, b)
  }.sortWith((a, b) ⇒ if (a.out == b.out) a.in < b.in else a.out < b.out)
  var max = 0
  var sum = 0L
  for (b ← bacterias) {
    sum += b.out
    queue.enqueue(b)
    while (queue.nonEmpty && queue.head.in * queue.size < sum) {
      val remove = queue.dequeue()
      sum -= remove.out
    }
    if (max < queue.size){
      max = queue.size
    }
  }
  println(max)

  case class Bacteria(out: Long, in: Long)
}
