Problem list
Log in
#coci00073 · COCI 2008/2009 Contest 1

Skocimis

Bronze III 1.0 s 32 MB

Three kangaroos are playing in the desert. They are playing on a number line, each occupying a different integer. In a single move, one of the outer kangaroos jumps into the space between the other two. At no point may two kangaroos occupy the same position. Help them play as long as possible.

Input

Three integers $A$, $B$ and $C$ ($0 < A < B < C < 100$), the initial positions of the kangaroos.

Output

Output the largest number of moves the kangaroos can make.

Example 1

Input
2 3 5
Output
1

Example 2

Input
3 5 9
Output
3
Source
COCI 2008/2009 Contest 1
Appears in
Not part of a ladder, contest or set yet.
Accepted 1 Submissions 1 Acceptance 100% Solvers 1

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code