Олимпиадный тренинг

Задача 42231. Neighboring squares


There is a grid with H horizontal rows and W vertical columns. Let (ij) denote the square in the i-th row from the top and in the j-th column on the left.
Find the number of squares that have a common side with the square (RC).

Square (ab) and square (cd) have one common side if and only if |a-c|+|b-d|=1 (where |x| denotes the absolute value of < code>x).

Input
The program receives two lines as input. The first line contains two integers H and W (1 <= H, W <= 10). The second line contains two integers R< /code> and C (1 <= H, W <= 10).

Imprint
Print the answer to the problem.
 
Examples
# Input Output
1 3 4
2 2
4
2 3 4
1 3
3

Grid image, for the examples described above