a = float (input ())
b = float (input ())
h = float (input ())

print ("{0:.2f}".format ((a + b) * h / 2))

a = float (input ())
b = float (input ())
h = float (input ())

print ("{0:.2f}".format ((a + b) * h / 2))
