from itertools import permutations L = list(map(int,input().split())) R,B,Y = map(int,input().split()) P = [i for i in range(3)] P = list(permutations(P, 3)) ans = 1<<64 for p in P: x = 0 y = 0 z = 0 for i in range(3): if p[i] == 0: x += L[i] y += L[i] if p[i] == 1: x += L[i] z += L[i] if p[i] == 2: y += L[i] z += L[i] ans = min(ans, (R * x * 2) + (B * y * 2) + (Y * z * 2)) print(ans)