On the magical land Byteland, there is an ancient kingdom called Fibonacci Kingdom.
There are cities in the kingdom(numbered from to ), and residents in the -th city.
denotes the -th number of Fibonacci sequence, such that each number is the sum of the two preceding ones, starting from and . That is, and for . The beginning of the sequence is thus: .
Unfortunately, one day, an earthquake occurred.
The earthquake destroyed the whole kingdom’s transportation system.
To deliver disaster relief supplies, the king decided to reconstruct the road.
plans have been proposed, and the -th plan is to reconstruct the bidirectional road linking and , denoted as .
The magic is that it takes exactly bitcoins to reconstruct the road .
The king wants to choose some plans to implement, but the rules below must be followed:
- After the reconstruction, the cities are mutually reachable (i.e., there is at least one path connecting any two cities).
- Minimize the bitcoin consumption.
- In the premise of the least bitcoin consumption, the largest degree among all the cities should be minimized(suppose is the degree of -th city, ), because the residents of the kingdom are not good at looking for ways. The definition of the degree of a city is the number of roads directly connected to the city.
Setsuna, the savior of the kingdom, has easily calculated the minimum consumption of bitcoin, but she desperately wants to know the minimum she can get after reconstruction.
It’s guaranteed that the answer always exists.
输入格式
The first line contains two integers .
The -th of the next lines contains two integers .
输出格式
Output one integer which indicates the minimum Setsuna can get.
提示
The graph of the sample is as follows.

In this situation, bitcoin consumption is . The degree of city is ; the degree of city is ; the degree of city is .
It can be proved that such solution is the best, so the answer is .