def aa(a,b,c,d):
    return (a+b)*(c-d)
a,b,c,d = map(int,input().split())
print(aa(a,b,c,d))