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

price = 0

P = []

s = 0

t = 0

u = 0

if A + B <= 2*C:

    price = A*X + B*Y

else:

    sa = abs(X - Y)

    price = C*2*(min(X, Y)-sa)

    XX = X - (min(X, Y)-sa)

    YY = Y - (min(X, Y)-sa)

    dai = max(XX, YY)

    syou = min(XX, YY)



    for i in range(dai+1):

        u = i*2

        if syou>=i:

            s = XX - i

            t = YY - i

        else:

            if X >= Y:

                s = XX - i

                t = 0

            else:

                s = 0

                t = YY - i

        P.append(A*s + B*t + C*u)

    price += min(P)



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



prise = A*X + B*Y

x = X

y = Y

anset = set()

anset.add(prise)

while max(x, y)>0:

    if x > 0:

        prise -= A

    if y > 0:

        prise -= B

    prise += C * 2

    anset.add(prise)



    x -= 1

    y -= 1



print((min(anset)))
A, B, C, X, Y = list(map(int, input().split()))
price = 0
P = []
s = 0
t = 0
u = 0
if A + B <= 2 * C:
    price = A * X + B * Y
else:
    sa = abs(X - Y)
    price = C * 2 * (min(X, Y) - sa)
    XX = X - (min(X, Y) - sa)
    YY = Y - (min(X, Y) - sa)
    dai = max(XX, YY)
    syou = min(XX, YY)
    for i in range(dai + 1):
        u = i * 2
        if syou >= i:
            s = XX - i
            t = YY - i
        else:
            if X >= Y:
                s = XX - i
                t = 0
            else:
                s = 0
                t = YY - i
        P.append(A * s + B * t + C * u)
    price += min(P)
print(price)

A, B, C, X, Y = list(map(int, input().split()))
prise = A * X + B * Y
x = X
y = Y
anset = set()
anset.add(prise)
while max(x, y) > 0:
    if x > 0:
        prise -= A
    if y > 0:
        prise -= B
    prise += C * 2
    anset.add(prise)
    x -= 1
    y -= 1
print((min(anset)))

-price = 0 -P = [] -s = 0 -t = 0 -u = 0 -if A + B <= 2 * C: -    price = A * X + B * Y -else: -    sa = abs(X - Y) -    price = C * 2 * (min(X, Y) - sa) -    XX = X - (min(X, Y) - sa) -    YY = Y - (min(X, Y) - sa) -    dai = max(XX, YY) -    syou = min(XX, YY) -    for i in range(dai + 1): -        u = i * 2 -        if syou >= i: -            s = XX - i -            t = YY - i -        else: -            if X >= Y: -                s = XX - i -                t = 0 -            else: -                s = 0 -                t = YY - i -        P.append(A * s + B * t + C * u) -    price += min(P) -print(price) +prise = A * X + B * Y +x = X +y = Y +anset = set() +anset.add(prise) +while max(x, y) > 0: +    if x > 0: +        prise -= A +    if y > 0: +        prise -= B +    prise += C * 2 +    anset.add(prise) +    x -= 1 +    y -= 1 +print((min(anset)))