import sys

def calculate(b:list):
    print((int(a[0])+int(a[1]))*(int(a[2])-int(a[3])))

a=input().split(" ")
calculate(a)