from itertools import * L = list(map(int, input().split())) C = list(map(int, input().split())) ans = 10 ** 18 for a, b, c in permutations(C): val = 2 * a * (L[0] + L[1]) val += 2 * b * (L[0] + L[2]) val += 2 * c * (L[1] + L[2]) ans = min(ans, val) print(ans)