Your favorite football team is playing in a charity tournament, part of a worldwide fundraiser for children with disabilities. Scoring works the usual way: the team that wins a match gets three points and the losing team gets nothing. A drawn match gives one point to each team.
Your team played N matches in the first phase, which has just finished. Only the teams with the most accumulated points go through to the second phase. Because the tournament exists to raise money, every team may buy extra goals before the list of advancing teams is settled. A bought goal counts exactly like a goal scored on the pitch, and it can change the result of any match the team played.
Your team's budget pays for at most G goals. You may split them across the matches however you want, and you may put several of them into one match. No other team buys goals. Find the largest total number of points your team can hold after the purchase.
The first line contains two integers N and G (1≤N≤105, 0≤G≤106), the number of matches your team played and the number of goals your team can buy.
Each of the next N lines describes one match result with two integers S and R (0≤S,R≤100), the goals your team scored and the goals it conceded in that match before any purchase.
Print one line with the maximum total number of points your team can get after buying the goals.