P6426 [COCI 2008/2009 #1] SKOCIMIS

Description

Three kangaroos are playing on a number line in the desert, and each kangaroo stands on a different integer point. In one move, a kangaroo that is not in the middle jumps into the space between the other two kangaroos. No two kangaroos may ever stand on the same position. Please let them play for as long as possible.

Input Format

Three integers $A, B, C$ representing the initial positions of the three kangaroos.

Output Format

Output the maximum number of moves the kangaroos can make.

Explanation/Hint

#### Constraints For $100\%$ of the testdata, $0 < A < B < C < 100$. #### Notes #### This problem is translated from [COCI2008-2009](https://hsin.hr/coci/archive/2008_2009/) [CONTEST #1](https://hsin.hr/coci/archive/2008_2009/contest1_tasks.pdf) SKOCIMIS, translator @[mnesia](https://www.luogu.com.cn/user/115711)。 Translated by ChatGPT 5