The Olympiad is over, and while the jury is tallying the scores, the participants decided to go to the nearest restaurant.
Due to epidemiological restrictions, the restaurant has only one round table with $$$n$$$ seats and exactly two waiters. The seats at the table are numbered from $$$1$$$ to $$$n$$$ in clockwise order. Thus, adjacent seats are $$$i$$$ and $$$i + 1$$$ for all $$$1 \le i \lt n$$$, as well as seats $$$n$$$ and $$$1$$$.
The restaurant manager, seeing that so many visitors have come, instructed the waiters to arrange utensils in front of each seat. Initially, there are no utensils anywhere. The first waiter stands next to seat number $$$a$$$, and the second waiter stands next to seat number $$$b$$$. In one second, a waiter can move from one seat to the adjacent one on the left or right. Each waiter has a cart with an infinite number of utensils, and if they are standing next to a seat without utensils, they instantly place them on that seat.
While the participants are waiting, they became interested in the minimum number of seconds required for the waiters to arrange utensils in front of each seat. Help them find the answer to this question.
The first line of input contains exactly one integer $$$n$$$ - the number of seats at the round table ($$$1 \le n \le 10^{18}$$$).
The second line contains two integers $$$a$$$ and $$$b$$$ separated by a space - the numbers of the seats next to which the first and second waiters are initially located ($$$1 \le a, b \le n$$$).
Print a single integer - the minimum number of seconds required for the waiters to arrange utensils in front of each seat.
Points for each subtask are awarded only if all tests for that subtask and the necessary subtasks are passed successfully.
| Subtask | Points | Constraints | Necessary subtasks | Verification information |
| 1 | 9 | $$$n \le 10$$$ | first error | |
| 2 | 14 | Seats $$$a$$$ and $$$b$$$ are the same or adjacent | first error | |
| 3 | 17 | $$$n \le 1\,000$$$ | 1 | first error |
| 4 | 31 | $$$n \le 100\,000$$$ | 1, 3 | first error |
| 5 | 29 | No additional constraints | 1–4 | first error |
5 1 3
2
7 3 1
3
One of the ways to arrange utensils in the first example:
One of the ways to arrange utensils in the second example:
| Name |
|---|


