Catch That Cow#7748

Catch That Cow

1 second
128 megabytes
Medium

Farmer John has received information about the location of a runaway cow, and he immediately sets off to catch her. He starts at point on the number line, while the cow is located at point on the same line. Farmer John has two modes of transportation:

Since the cow is unaware of being pursued, she does not move. Determine the minimum amount of time it will take Farmer John to catch her.

Input

A single line contains two integers and k~(0 \le n, k \le 10^5) — the starting positions of Farmer John and the cow, respectively.

Output

Print the minimum number of minutes required for Farmer John to reach the cow.

Examples

The fastest path for Farmer John to reach the runaway cow is: 5 \rightarrow 10 \rightarrow 9 \rightarrow 18 \rightarrow 17, which takes minutes.

Example 1

Loading
Loading