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

p=[0]*3

p[0]=a*x+b*y

if x<=y:

    p[1]=2*c*y

    p[2]=2*c*x+b*(y-x)

elif x>y:

    p[1]=2*c*x

    p[2]=a*(x-y)+2*c*y

print((min(p)))

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

ans=min(x*a+y*b,2*max(x,y)*c)

if x>=y:

    ans=min(ans,2*y*c+(x-y)*a)

else:

    ans=min(ans,2*x*c+(y-x)*b)

print(ans)
a, b, c, x, y = list(map(int, input().split()))
p = [0] * 3
p[0] = a * x + b * y
if x <= y:
    p[1] = 2 * c * y
    p[2] = 2 * c * x + b * (y - x)
elif x > y:
    p[1] = 2 * c * x
    p[2] = a * (x - y) + 2 * c * y
print((min(p)))

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

-p = [0] * 3 -p[0] = a * x + b * y -if x <= y: -    p[1] = 2 * c * y -    p[2] = 2 * c * x + b * (y - x) -elif x > y: -    p[1] = 2 * c * x -    p[2] = a * (x - y) + 2 * c * y -print((min(p))) +ans = min(x * a + y * b, 2 * max(x, y) * c) +if x >= y: +    ans = min(ans, 2 * y * c + (x - y) * a) +else: +    ans = min(ans, 2 * x * c + (y - x) * b) +print(ans)