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

l = 0

p = x



if x > y:

    l += (x - y) * a

    p = y

elif x < y:

    l += (y - x) * b

    p = x

else:

    pass

l += p * 2 * c

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

m = x * a + y * b

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

l = 0

flg = x

if x > y:

    l += (x - y) * a

    flg = y

elif x < y:

    l += (y - x) * b

else:

    pass

l += flg * 2 * c

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

m = x * a + y * b

print((min(l,n,m)))
a, b, c, x, y = list(map(int, input().split()))
l = 0
p = x
if x > y:
    l += (x - y) * a
    p = y
elif x < y:
    l += (y - x) * b
    p = x
else:
    pass
l += p * 2 * c
n = max(x, y) * 2 * c
m = x * a + y * b
print((min(l, n, m)))

a, b, c, x, y = list(map(int, input().split()))
l = 0
flg = x
if x > y:
    l += (x - y) * a
    flg = y
elif x < y:
    l += (y - x) * b
else:
    pass
l += flg * 2 * c
n = max(x, y) * 2 * c
m = x * a + y * b
print((min(l, n, m)))

-p = x +flg = x -    p = y +    flg = y -    p = x -l += p * 2 * c +l += flg * 2 * c