import sys; input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")

def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	L = []
	for i in range(26):
		a = int(input())
		L.append(a)

	h = L[7]
	e = L[4]
	w = L[22]
	r = L[17]
	d = L[3]
	ans = h * e * w * r * d

	l = L[11]
	o = L[14]
	lmax = 0
	omax = 0
	for i in range(1, 101):
		lmax = max(lmax, int(i * (i - 1) * (l - i) // 2))
		omax = max(omax, i * (o - i))

	ans *= lmax * omax
	print(ans)

if __name__ == '__main__':
	main()