a,b,c,d = map(int,input().split())

result = (a+b-c) * d

print(result)