Mytsyk's Holiday#53

Mytsyk's Holiday

1 second
64 megabytes
Easy

There is a rectangular hangar of size M \times N (horizontal by vertical). The hangar floor is covered with triangular tiles, numbered as shown in the image below.

prb53

Mytsyk can move from one tile to an adjacent tile (sharing a common side) in a single step. Starting from tile , what is the minimal number of steps Mytsyk must take to reach tile , where a piece of cheese is located?

Input

The first line contains two integers and (1 \leq M, N \leq 30000) — the dimensions of the hangar.

The second line contains two integers: , the number of the tile where Mytsyk starts, and , the number of the tile with the cheese.

Output

Print a single integer — the minimal number of steps Mytsyk must take.

Examples

Example 1

Loading
Loading