from itertools import permutations x, y, z = map(int, input().split()) C = list(map(int, input().split())) L = [2 * (x + y), 2 * (y + z), 2 * (z + x)] ans = 10**18 for P in permutations(range(3)): res = 0 for i in range(3): res += C[P[i]] * L[i] ans = min(ans, res) print(ans)