Maharaja#6362

Maharaja

1 second
64 megabytes
Very easy

While exploring the history of chess, our heroes discovered a variant featuring a unique piece known as the Maharaja. This piece combines the powers of both the queen and the knight. With a grin, Vernygora presented his friends with the following challenge: Determine the minimum number of moves the Maharaja needs to visit every square on a rectangular board of size M \times N (1 \leq N, M \leq 2000000000) and return to the starting square.

Note: The Maharaja can move any number of squares vertically, horizontally, or diagonally, and can also move like a knight—two squares in one direction and one in the perpendicular direction, or vice versa.

A move is defined as the Maharaja transitioning from one square to another according to these movement rules.

Input

-st line contains two integers and , separated by a space, representing the dimensions of the board.

-nd line contains two integers and , separated by a space, indicating the starting position of the Maharaja.

Output

Output a single integer—the minimum number of moves the Maharaja needs to make to visit all squares and return to the starting position.

Examples

Example 1

Loading
Loading