Tudor is buying blocks of cheese. Each block of cheese has a regular price and a discounted price.
Tudor has coupons that allow him to buy a block of cheese for the discounted price instead of the regular price. Each coupon can be used for exactly one block of cheese.
Given that Tudor wants to buy all blocks of cheese, compute the minimum amount of money he must spend.
The first line contains two space separated integers, and .
The next lines each contain two space separated integers, and representing the regular price and discounted price of block , respectively.
Output the minimum amount of money Tudor must spend.
2 1 100 0 10 10