H. Chess knight on the curb stone
time limit per test
0.25 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

From a checkered field of $$$n$$$ rows and $$$m$$$ columns ($$$5 \leq n, m \leq 1000$$$), the inner part of size $$$(n-4) \times (m-4)$$$ was cut out so that on the sides of it there remained strips of $$$2$$$ cells in width.

There is a chess knight on the top left square of the field. Is it possible, using only narrow strips of $$$2$$$ cells width, to go around the cutout with the knight, and return to the original (initial) cell? And if it is possible, what is the minimum number of moves required for this (the knight follows the chess rules)?

For example, if there is a field $$$5 \times5$$$ (the square $$$(3, 3)$$$ is cut out), then the knight can go around the cut in $$$4$$$ moves: $$$(1, 1) \rightarrow (3, 2) \rightarrow (4, 4) \rightarrow (2, 3) \rightarrow (1, 1)$$$.

Note. At the moment of movement, the knight cannot jump over the cut cells.

Input

The size of the field is given as two integers $$$n$$$ and $$$m$$$ ($$$5 \leq n, m \leq 1000$$$), separated by a space.

Output

Output $$$0$$$ if it is impossible to walk around the cutout, or the required number of the knight's moves for such a walk is minimal.

Examples
Input
5 5
Output
4
Input
20 15
Output
30
Input
1000 1000
Output
1996
Input
5 6
Output
6