def hanshu(x,y):
global cnt
if [x,y] in ls:
return None
else:
if x==a and y==b:
cnt+=1
return None
elif x==a:
hanshu(x,y+1)
elif y==b:
hanshu(x+1,y)
else:
hanshu(x+1,y)
hanshu(x,y+1)
a,b,c,d=map(int,input().split())
ls=[[c-1,d-2],[c-2,d-1],[c+1,d-2],[c+2,d-1],[c+2,d+1],[c+1,d+2],[c-1,d+2],[c-2,d+1]]
cnt=0
hanshu(0,0)
print(cnt)