#Lutece0434. Weights and Measures

Weights and Measures

Migrated from Lutece 434 Weights and Measures

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

I know, up on top you are seeing great sights,

But down at the bottom, we, too, should have rights.

We turtles can't stand it. Our shells will all crack!

Besides, we need food. We are starving!" groaned Mack.

Mack, in an effort to avoid being cracked, has enlisted your advice as to the order in which turtles should be dispatched to form Yertle's throne. Each of the five thousand, six hundred and seven turtles ordered by Yertle has a different weight and strength. Your task is to build the largest stack of turtles possible.

The weight of the turtle is in grams. The strength, also in grams, is the turtle's overall carrying capacity, including its own weight. That is, a turtle weighing 300300g with a strength of 10001000g could carry 700700g of turtles on its back.

Input

There is only one test case in the input.

Standard input consists of several lines, each containing a pair of integers separated by one or more space characters, specifying the weight and strength of a turtle (wsw\leq s).There are at most 5,6075,607 turtles.

Output

Your output is a single integer indicating the maximum number of turtles that can be stacked without exceeding the strength of any one.

Samples

300 1000
1000 1200
200 600
100 101
3

Resources

Liu Rujia