import sys sys.setrecursionlimit(10 ** 6) int1 = lambda x: int(x) - 1 p2D = lambda x: print(*x, sep="\n") def MI(): return map(int, sys.stdin.readline().split()) def LI(): return list(map(int, sys.stdin.readline().split())) def LLI(rows_number): return [LI() for _ in range(rows_number)] def main(): a = [int(input()) for _ in range(26)] a11 = a[11] if a11 > 2: pl = max(n * (n - 1) * (a11 - n) // 2 for n in range(1, a11)) else: pl = 0 a14 = a[14] po = (a14 // 2) * (a14 - a14 // 2) ans = a[3] * a[4] * a[7] * a[17] * a[22] * pl * po print(ans) main()