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

price = 10**10

for k in range(10**5+1):

    re = 2*c*k + max(0,x-k)*a + max(0,y-k)*b

    price = min(re,price)

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

a1 = a*x + b*y

a2 = max(x,y) * 2*c

if y >= x:

    a3 = 2*c*x + (y-x)*b

else:

    a3 = 2*c*y + (x-y)*a

print((min(a1,a2,a3)))
a, b, c, x, y = list(map(int, input().split()))
price = 10**10
for k in range(10**5 + 1):
    re = 2 * c * k + max(0, x - k) * a + max(0, y - k) * b
    price = min(re, price)
print(price)

a, b, c, x, y = list(map(int, input().split()))
a1 = a * x + b * y
a2 = max(x, y) * 2 * c
if y >= x:
    a3 = 2 * c * x + (y - x) * b
else:
    a3 = 2 * c * y + (x - y) * a
print((min(a1, a2, a3)))

-price = 10**10 -for k in range(10**5 + 1): -    re = 2 * c * k + max(0, x - k) * a + max(0, y - k) * b -    price = min(re, price) -print(price) +a1 = a * x + b * y +a2 = max(x, y) * 2 * c +if y >= x: +    a3 = 2 * c * x + (y - x) * b +else: +    a3 = 2 * c * y + (x - y) * a +print((min(a1, a2, a3)))