Ground Is Lava
View as PDFWindra has just won gold in the Olympic pole vault, and in the rush of excitement they leave the stadium still carrying their pole. Then they hear that their long-lost brother Bindra is waiting somewhere in the Olympic village. Windra starts at point , Bindra is at point
, and every point in the village is represented by an integer on a number line.
Windra can move in two ways:
- For every integer
, they may walk between points
and
.
- For every integer
, there are vault pads at points
and
, and Windra may use the pole to launch between these two points.
Each walk or vault takes exactly one minute.
Given ,
, and
, find the minimum number of minutes Windra needs to reach Bindra.
Input
The only line contains three integers ,
, and
(
,
), in this order.
Output
Print one integer: the minimum number of minutes needed to get from point to point
.
Example 1
Input
4 1 10
Output
5
Explanation
In the sample, one optimal route is:
Comments