e-olymp
Problems

Paint2D-Crack

Paint2D-Crack

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 x N, and on him builds the maximally possible amount of rectangles by size 1 x 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 90o.

We remind, that the licensed graphics editor was able to execute operations "select", "copy" "move" and "insert"

Input

2 number is N and M. 1 <= N, M <= 1000.

Output

Amount of the К operations.

Time limit 1 second
Memory limit 64 MiB
Input example #1
4 3
Output example #1
19
Author Анатолий Присяжнюк