#include<stdio.h>
int n, m, mx, my, ans;
int next[2][2] = { {1,0},{0,1} };
int nn[9][2] = { {0,0},{1,2},{2,1},{2,-1},{1,-2},{-1,-2},{-2,-1},{-1,2},{-2,1} };
void dfs(int x, int y) {
int tx, ty;
if (x == n && y == m) ans++;
for (int i = 0; i <= 1; i++) {
tx = x + next[i][0];
ty = y + next[i][1];
if (tx<0 || ty<0 || tx>n || ty>m) {
continue;
}
if (tx == mx && ty == my || tx == mx + 1 && ty == my + 2 || tx == mx + 2 && ty == my + 1 || tx == mx + 2 && ty == my - 1 || tx == mx + 1 && ty == my - 2 || tx == mx - 1 && ty == my - 2 || tx == mx - 2 && ty == my - 1 || tx == mx - 1 && ty == my + 2 || tx == mx - 2 && ty == my + 1) {
continue;
}
dfs(tx, ty);
}
return;
}
int main() {
scanf("%d %d %d %d", &n, &m, &mx, &my);
n += 2; m += 2; mx += 2; my += 2;
dfs(2, 2);
printf("%d\n", ans);
return 0;
}