Y has n lines of code and want to move the nth line of code to the ith line of code.
Y can use two methods for this work:
What is the minimum number of keys that Y has to press?
Input
The only line of input is n and i separated by space.
1≤i≤n≤109
Output
A single line, the minimum number of keys that Y has to press to do the job.
Y can do both methods and press 8 keys.