import java.util.Scanner;
public class test {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int m = in.nextInt();
int horse_x = in.nextInt();
int horse_y = in.nextInt();
int[][] horse = {{-2, -1}, {-2, 1}, {2, -1}, {2, 1},
{-1, -2}, {-1, 2}, {1, -2}, {1, 2}};
int[][] dp = new int[n + 1][m + 1];
dp[horse_x][horse_y] = -1;
for (int i = 0; i < 8; i++) {
dp[horse_x + horse[i][0]][horse_y + horse[i][1]] = -1;
}
dp[0][0] = 1;
for (int i = 0; i <= n; i++) {
for (int j = 0; j <= m; j++) {
if (dp[i][j] == -1) {
dp[i][j] = 0;
} else if (i == 0 || j == 0) {
dp[i][j] = 1;
} else {
dp[i][j] = Math.max(dp[i][j], dp[i - 1][j] + dp[i][j - 1]);
}
}
}
System.out.println(dp[n][m]);
}
}
```java