A, B, C, X, Y = list(map(int, input().split()))

ans = float('inf')

for i in range(max(X,Y)+1):

    cost = 2 * C * i + max(0,X-i)*A +max(0,Y-i)*B

    ans = min(ans,cost)

print(ans)
A, B, C, X, Y = list(map(int, input().split()))

tmp = A*X + B*Y

if X >= Y:

    tmp = min(tmp,2*Y*C+(X-Y)*A)

else:

    tmp = min(tmp,2*X*C+(Y-X)*B)

tmp = min(tmp,max(X,Y)*2*C)

print(tmp)
A, B, C, X, Y = list(map(int, input().split()))
ans = float("inf")
for i in range(max(X, Y) + 1):
    cost = 2 * C * i + max(0, X - i) * A + max(0, Y - i) * B
    ans = min(ans, cost)
print(ans)

A, B, C, X, Y = list(map(int, input().split()))
tmp = A * X + B * Y
if X >= Y:
    tmp = min(tmp, 2 * Y * C + (X - Y) * A)
else:
    tmp = min(tmp, 2 * X * C + (Y - X) * B)
tmp = min(tmp, max(X, Y) * 2 * C)
print(tmp)

-ans = float("inf") -for i in range(max(X, Y) + 1): -    cost = 2 * C * i + max(0, X - i) * A + max(0, Y - i) * B -    ans = min(ans, cost) -print(ans) +tmp = A * X + B * Y +if X >= Y: +    tmp = min(tmp, 2 * Y * C + (X - Y) * A) +else: +    tmp = min(tmp, 2 * X * C + (Y - X) * B) +tmp = min(tmp, max(X, Y) * 2 * C) +print(tmp)