from collections import deque
n, m, x, y = map(int, input().split())
st=set()
ma=[[1,2],[1,-2],[2,1],[2,-1],[-1,2],[-1,-2],[-2,1],[-2,-1]]
zu=[[1,0],[0,1]]
for z in ma:
st.add((x+z[0],y+z[1]))
def is_valid(b):
return 0<=b[0]<=n and 0<=b[1]<=m and (b not in st)
q=deque()
q.append((0,0))
res=0
while len(q)>0:
cur=q.popleft()
for z in zu:
cur1=(cur[0]+z[0],cur[1]+z[1])
if is_valid(cur1):
if cur1==(n,m):
res+=1
else:
q.append(cur1)
print(res)