Number of toys#927

Number of toys

1 second
128 megabytes
Very easy

A store offers an assortment of toys of various types. For each type, the number of toys and the price of one toy are known. Determine the total number of toys with a price less than hryvnias.

Input

The first line contains an integer n~(0 \le n \le 1000) — the number of toy types in the price list. Each of the following lines contains two integers:

  • a~(0 \le a \le 1000) — the number of toys of this type, and

  • b~(0 < b \le 10000) — the price of one toy of this type, in hryvnias.

Output

Print the total number of toys with a price less than hryvnias.

Examples

Example 1

Loading
Loading