Number of toys
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
You are given the number of types of toys in the shop, along with the quantity and cost of each type. Find the total number of toys that cost less than grn.
Input
The first line contains the number of types of toys . Each of the next lines contains two numbers: the count of toys of the next type and the price of each toy in grn.
Output
Print the total number of toys that cost less than grn.
Examples
Input #1
Answer #1
Submissions 27K
Acceptance rate 49%