L = list(map(int, input().split())) ShuL = [2 * (sum(L) - L[i]) for i in range(3)] ShuN = list(map(int, input().split())) ShuL.sort() ShuN.sort(reverse = True) ans = 0 for i in range(3): ans += ShuL[i] * ShuN[i] print(ans)