407001: GYM102672 I Tennis score
Description
Aurora and Knotgrass decided to play tennis and asked Thistlelwit to be the judge. At the start the score was $$$0 : 0$$$. Then, a few times the score increased by $$$1$$$. The game ended with the score $$$a : b$$$.
Thistlelwit was bored so she counted the sum of the gcds of the players' scores after each score change. the gcd — is the greatest divisor of two numbers. For example, the game could go as follows:
- $$$0 : 0$$$
- $$$1 : 0$$$, $$$\textrm{gcd}(1, 0) = 1$$$
- $$$2 : 0$$$, $$$\textrm{gcd}(2, 0) = 2$$$
- $$$2 : 1$$$, $$$\textrm{gcd}(2, 1) = 1$$$
- $$$2 : 2$$$, $$$\textrm{gcd}(2, 2) = 2$$$
- $$$2 : 3$$$, $$$\textrm{gcd}(2, 3) = 1$$$
In that case, Thistlelwit would get $$$1 + 2 + 1 + 2 + 1 = 7$$$.
After the end of the game Thistlelwit got curious about what minimal number she could potentially get. Please, help her calculate that number.
InputThe first line contains two integers $$$a$$$ and $$$b$$$ — the final scores of Aurora and Knotgrass ($$$0 \le a, b \le 10^9$$$).
OutputOutput one number — the minimal score which Thistlelwit could get.
ExamplesInput2 1Output
3Input
4 6Output
11Input
0 0Output
0Input
10 10Output
31