Score : $300$ points
Snuke has a calculator. It has a display and two buttons.
Initially, the display shows an integer $x$. Snuke wants to change this value into another integer $y$, by pressing the following two buttons some number of times in arbitrary order:
Find the minimum number of times Snuke needs to press the buttons to achieve his objective. It can be shown that the objective is always achievable regardless of the values of the integers $x$ and $y$.
The input is given from Standard Input in the following format:
Print the minimum number of times Snuke needs to press the buttons to achieve his objective.
Press button A ten times.
Press button B once.
Press the buttons as follows: