ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules

1051. Simple Game on a Grid

Time limit: 1.0 second
Memory limit: 64 MB
There is an infinite grid and an M × N rectangle of stones on it (1 ≤ MN ≤ 10000). 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 you are to write a program which should determine a minimal number of the stones left on the grid.

Input

Numbers M and N separated by space.

Output

The minimal number of the stones left on the grid.

Sample

inputoutput
3 4
2
Problem Author: Stanislav Vasilyev
Problem Source: Ural State University collegiate programming contest (25.03.2000)