The beginning hacker-programmer Nevmiyko injured the source code of the licensed acquired graphics editor Paint2D. After the start an editor automatically creates the working field in a kind to the square by size N × N, and on him builds the maximally possible amount of rectangles by size 1 × M.
You know N and М, help to count up to Nevmiyko, what amount of operations К here automatically executes editor, if at the start he has only a template to the square 1 × 1, and as a result of the unsuccessful breaking is able yet and "rotate" a rectangle 1 × М on 90°.
We remind, that the licensed graphics editor was able to execute operations "select", "copy" "move" and "insert".
2 number is N and M (1 ≤ N, M ≤ 1000).
Amount of the К operations.