x,y,z,p = map(int,input().split())
print((x+y)*(z-p))