#include <bits/stdc++.h>
using namespace std;
long long xa,ya,xh,yh,f[30][30]={0},pand[30][30]={0};//尽量用long long
int main(){
//输入
cin>>xa>>ya>>xh>>yh;
xa+=2;//-----设置保护墙
ya+=2;
xh+=2;
yh+=2;
//边界赋值
for(int i=2;i<30;i++){
f[i][2]=1;
f[2][i]=1;
}
//特殊点赋值
pand[xh][yh]=1;
pand[xh-2][yh-1]=1;
pand[xh-2][yh+1]=1;
pand[xh-1][yh-2]=1;
pand[xh-1][yh+2]=1;
pand[xh+1][yh-2]=1;
pand[xh+1][yh+2]=1;
pand[xh+2][yh-1]=1;
pand[xh+2][yh+1]=1;
f[1][2]=1;
//关系式计算
for(int i=2;i<=xa;i++){
for(int j=2;j<=ya;j++){
if(pand[i][j]==1){
f[i][j]=0;
continue;
}
f[i][j]=f[i-1][j]+f[i][j-1];
}
}
//输出
cout<<f[xa][ya];
return 0;
}