c = [0] * 27 for i in range(1, 27): c[i] = int(input()) res = c[4] * c[5] * c[8] * (c[15] // 2) * (c[15] - c[15] // 2) * c[18] * c[23] if c[12] >= 3: comb_max = 0 for l_world in range(1, c[12] - 2 + 1): l_hello = c[12] - l_world comb = (l_hello * (l_hello - 1) // 2) * l_world comb_max = max(comb, comb_max) res *= comb_max else: res = 0 print(res)