Problems
Farmer John has lost his prize cow Bessie, and he needs to find her!
Fortunately, there is only one long path running across the farm, and Farmer John knows that Bessie has to be at some location on this path. If we think of the path as a number line, then Farmer John is currently at position
Trying to figure out the best strategy for walking back and forth in his search, Farmer John consults the computer science research literature and is somewhat amused to find that this exact problem has not only been studied by computer scientists in the past, but that it is actually called the "Lost Cow Problem" (this is actually true!).
The recommended solution for Farmer John to find Bessie is to move to position
Farmer John is curious to verify this result. Given
Input
The single line of input contains two distinct space-separated integers
Output
Print one line of output, containing the distance Farmer John will travel to reach Bessie.
Example
3 6
9