import math



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



cost = []

cost.append(A*X + B*Y)



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

    cost.append(C*i + max(0, math.ceil(X-i/2)*A) + max(0, math.ceil(Y-i/2)*B))



print((min(cost)))
a, b, c, x, y = list(map(int, input().split()))



ans = float('inf')

for k in range(2*max(x, y)+1):

    cost = c * k

    need_x = max(0, x - k // 2)

    need_y = max(0, y - k // 2)

    cost += a * need_x + b * need_y

    ans = min(ans, cost)

print(ans)
import math

A, B, C, X, Y = list(map(int, input().split()))
cost = []
cost.append(A * X + B * Y)
for i in range(2 * min(X, Y), 2 * max(X, Y) + 1):
    cost.append(
        C * i + max(0, math.ceil(X - i / 2) * A) + max(0, math.ceil(Y - i / 2) * B)
    )
print((min(cost)))

a, b, c, x, y = list(map(int, input().split()))
ans = float("inf")
for k in range(2 * max(x, y) + 1):
    cost = c * k
    need_x = max(0, x - k // 2)
    need_y = max(0, y - k // 2)
    cost += a * need_x + b * need_y
    ans = min(ans, cost)
print(ans)

-import math - -A, B, C, X, Y = list(map(int, input().split())) -cost = [] -cost.append(A * X + B * Y) -for i in range(2 * min(X, Y), 2 * max(X, Y) + 1): -    cost.append( -        C * i + max(0, math.ceil(X - i / 2) * A) + max(0, math.ceil(Y - i / 2) * B) -    ) -print((min(cost))) +a, b, c, x, y = list(map(int, input().split())) +ans = float("inf") +for k in range(2 * max(x, y) + 1): +    cost = c * k +    need_x = max(0, x - k // 2) +    need_y = max(0, y - k // 2) +    cost += a * need_x + b * need_y +    ans = min(ans, cost) +print(ans)