问题1935--Simple game on a grid

1935: Simple game on a grid

[命题人 : ]
时间限制 : 1.000 sec  内存限制 : 64 MB

题目描述

There is an infinite grid and an m*n rectangle of stones on it (1 <= m,n <= 1000). The stones are located in the knots of the grid. A following game for a single player is being played. One stone can jump over another along a vertical or a horizontal line. A stone which had been overjumped is taken away. The purpose of the game is to minimize number of stones on a grid. Given a pair of numbers m and n separated with one space in an input file you are to write a program which should determine a minimal number of the stones left on the grid.

输入

Numbers m and n separated by space.

输出

The minimal number of the stones left on the grid.

样例输入 Copy

3 4

样例输出 Copy

2