C = [int(input()) for _ in range(26)] X = 0 Y = C[3]*C[4]*C[7]*(C[14]//2)*(C[14]-C[14]//2)*C[17]*C[22] for i in range(C[11]+1): X = max(X, i*(i-1)//2*(C[11]-i)) print(X*Y)