Bishops on Black#8648

Bishops on Black

0.2 seconds
64 megabytes
Medium

We have a chessboard with dimensions M \times N squares, where the bottom-left square is black. Determine the maximum number of bishops that can be placed on the black squares of this board such that no two bishops can attack each other. Remember, bishops attack each other if they are positioned on the same diagonal.

Input

The input consists of natural numbers 1 \leq M, N \leq 10^9.

Output

Provide the maximum number of bishops that can be placed under the given conditions.

Examples

Example 1

Loading
Loading