#include <bits/stdc++.h>
using namespace std;
int maps[4][8];
int dx[4]={1,0,0,1};
int dy[4]={0,1,0,1};
int bx,by,ans,x,y;
void work(long long x,long long y){
maps[x][y]=1;
maps[x-1][y-2]=1;
maps[x-2][y-1]=1;
maps[x-2][y+1]=1;
maps[x-1][y+2]=1;
maps[x+1][y-2]=1;
maps[x+2][y-1]=1;
maps[x+2][y+1]=1;
maps[x+1][y+2]=1;
}
void dfs(int x1,int y1,int step){
if(x1==bx && y1==by){
++ans;
return ;
}
for(int i=0;i<4;i++){
int nx=x1+dx[i];
int ny=y1+dy[i];
if(nx>=0 && nx<4 && ny>=0 && ny<8 && maps[nx][ny]==0){
maps[nx][ny]=1;
dfs(nx,ny,step+1);
maps[nx][ny]=0;
}
}
}
int main(){
cin>>bx>>by>>x>>y;
work(x,y);
dfs(0,0,5);
cout<<ans<<endl;
}