a=int(eval(input()))

b=int(eval(input()))

h=int(eval(input()))

print(((a+b)*h//2))
print(((int(eval(input()))+int(eval(input())))*int(eval(input()))//2))
a = int(eval(input()))
b = int(eval(input()))
h = int(eval(input()))
print(((a + b) * h // 2))

print(((int(eval(input())) + int(eval(input()))) * int(eval(input())) // 2))

-a = int(eval(input())) -b = int(eval(input())) -h = int(eval(input())) -print(((a + b) * h // 2)) +print(((int(eval(input())) + int(eval(input()))) * int(eval(input())) // 2))