For his birthday, Jaś received a set of magical electric cables. Each cable consists of one wire and one battery. The i-th wire can withstand a voltage of di volts, and the i-th battery supplies a voltage of bi volts.
Jaś builds circuits from the cables: he picks some cables, twists their wires together into a single thicker wire, and bends that wire into a loop. The voltage across the loop equals the sum of the voltages of all the chosen batteries, and the twisted wire can withstand a voltage equal to the sum of the voltages that the individual wires can withstand.
A loop burns out if the voltage across it exceeds what the wire can withstand. Jaś wants to build a loop that does not burn out, so the sum of the chosen battery voltages must not exceed the sum of the chosen wire tolerances. What is the greatest number of cables the loop can consist of?
The first line contains a single integer n (1≤n≤500000), the number of cables. Each of the next n lines contains two integers di, bi (0≤di,bi≤106) describing one cable.
Print a single integer: the maximum number of cables that can form a loop which does not burn out.