402514: GYM100796 H Game of Corners

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

H. Game of Cornerstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Alice is playing the Game of Corners. She is given a rectangular grid with n rows and m columns. During one move, Alice can choose any two previously unused cell borders that have a common point and join them in a corner (pictured). A corner can be oriented in any way.

Initially the grid is clear of corners. How many moves can Alice possibly make?

Input

The only line of the input contains two integers n and m (1 ≤ n, m ≤ 109) — the number of rows and the number of columns in the grid.

Output

Output a single integer — the maximum number of moves Alice can make.

ExamplesInput
2 3
Output
8
Input
1 1
Output
2
Note

Two corners can share a point on the grid, but cannot share a cell border.

For the first given sample, one possible arrangement of corners is:

加入题单

算法标签: