A triangle field is numbered with successive integers in the way shown on the picture below.

The traveller needs to go from the cell with number *m* to the cell with number *n*. The traveller is able to enter the cell through cell edges only, he can not travel from cell to cell through vertices. The number of edges the traveller passes makes the length of the traveller's route.

Write the program to determine the length of the shortest route connecting cells with numbers *m* and *n*.

### Input

Input contains integers *m* and *n* separated with space (1 ≤ *m*, *n* ≤ 10^{9}).

### Output

Output the length of the shortest route.

### Sample

**Problem Source: **II Collegiate Students Urals Programming Contest. Yekaterinburg, April 3-4, 1998