Queen Move#1417

Queen Move

1 second
128 megabytes
Very easy

A queen is placed on an m \times n chessboard. Determine how many squares are under its attack.

Input

Four positive integers: the size of the chessboard and , as well as the coordinates of the queen and (1 \le x \le m \le 10^9,\ 1 \le y \le n \le 10^9).

Output

Print the number of squares under the queen's attack.

Examples

Example 1

Loading
Loading