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



z = max(x,y) * 2

min_sum = c * z



for i in range(z):

    r = max(0, y - i) * b

    t = max(0, x - i) * a

    sum = c * i * 2 + r + t

    if sum < min_sum:

        min_sum = sum



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



plan_a = c * (2*x) + max(0, y-x) * b

plan_b = c * (2*y) + max(0, x-y) * a

plan_c = a * x + b * y



print((min(plan_a, plan_b, plan_c)))
a, b, c, x, y = list(map(int, input().split()))
z = max(x, y) * 2
min_sum = c * z
for i in range(z):
    r = max(0, y - i) * b
    t = max(0, x - i) * a
    sum = c * i * 2 + r + t
    if sum < min_sum:
        min_sum = sum
print(min_sum)

a, b, c, x, y = list(map(int, input().split()))
plan_a = c * (2 * x) + max(0, y - x) * b
plan_b = c * (2 * y) + max(0, x - y) * a
plan_c = a * x + b * y
print((min(plan_a, plan_b, plan_c)))

-z = max(x, y) * 2 -min_sum = c * z -for i in range(z): -    r = max(0, y - i) * b -    t = max(0, x - i) * a -    sum = c * i * 2 + r + t -    if sum < min_sum: -        min_sum = sum -print(min_sum) +plan_a = c * (2 * x) + max(0, y - x) * b +plan_b = c * (2 * y) + max(0, x - y) * a +plan_c = a * x + b * y +print((min(plan_a, plan_b, plan_c)))