import java.util.*;
import java.lang.*;
import java.io.*;
class Main
{
{
Scanner in
= new Scanner
(System.
in); int n = in.nextInt();
int m = in.nextInt();
int x = in.nextInt();
int y = in.nextInt();
int[][] arr = new int [n][m];
int num = 0;
for(int i = 0; i < n; ++i) {
int dir, j;
if(i % 2 == 0){
j = 0;
dir = 1;
}
else {
j = m-1;
dir = -1;
}
for(; j < m && j >= 0; j+= dir) {
arr[i][j] = num;
++num;
}
}
System.
out.
print(arr
[x
- 1][y
- 1]); }
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgpjbGFzcyBNYWluCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCVNjYW5uZXIgaW4gPSBuZXcgU2Nhbm5lcihTeXN0ZW0uaW4pOwoJCWludCBuID0gaW4ubmV4dEludCgpOwoJCWludCBtID0gaW4ubmV4dEludCgpOwoJCWludCB4ID0gaW4ubmV4dEludCgpOwoJCWludCB5ID0gaW4ubmV4dEludCgpOwoJCWludFtdW10gYXJyID0gbmV3IGludCBbbl1bbV07CgkJaW50IG51bSA9IDA7CgkJZm9yKGludCBpID0gMDsgaSA8IG47ICsraSkgewoJCQlpbnQgZGlyLCBqOwoJCQlpZihpICUgMiA9PSAwKXsKCQkJCWogPSAwOwoJCQkJZGlyID0gMTsKCQkJfQoJCQllbHNlIHsKCQkJCWogPSBtLTE7CgkJCQlkaXIgPSAtMTsKCQkJfQoJCQlmb3IoOyBqIDwgbSAmJiBqID49IDA7IGorPSBkaXIpIHsKCQkJCWFycltpXVtqXSA9IG51bTsKCQkJCSsrbnVtOwoJCQl9CgkJfQoJCVN5c3RlbS5vdXQucHJpbnQoYXJyW3ggLSAxXVt5IC0gMV0pOwoJfQp9