import math



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



# cを全探索？

res = float('inf')

for i in range(max(x,y)*2+1):

    money = i * c

    if i/2<x:

        money += math.ceil(x-i/2) * a

    if i/2<y:

        money += math.ceil(y-i/2) * b

    res = min(res,money)



print(res)

res = 10**30

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

for i in range(0,max(x,y)+1):

    # ABを2*iまい買う

    tmp = 2 * i * c

    xx,yy = x - i, y - i

    tmp += max(0,xx) * a

    tmp += max(0,yy) * b

    res = min(res, tmp)

print(res)

import math

a, b, c, x, y = list(map(int, input().split()))
# cを全探索？
res = float("inf")
for i in range(max(x, y) * 2 + 1):
    money = i * c
    if i / 2 < x:
        money += math.ceil(x - i / 2) * a
    if i / 2 < y:
        money += math.ceil(y - i / 2) * b
    res = min(res, money)
print(res)

res = 10**30
a, b, c, x, y = list(map(int, input().split()))
for i in range(0, max(x, y) + 1):
    # ABを2*iまい買う
    tmp = 2 * i * c
    xx, yy = x - i, y - i
    tmp += max(0, xx) * a
    tmp += max(0, yy) * b
    res = min(res, tmp)
print(res)

-import math - +res = 10**30 -# cを全探索？ -res = float("inf") -for i in range(max(x, y) * 2 + 1): -    money = i * c -    if i / 2 < x: -        money += math.ceil(x - i / 2) * a -    if i / 2 < y: -        money += math.ceil(y - i / 2) * b -    res = min(res, money) +for i in range(0, max(x, y) + 1): +    # ABを2*iまい買う +    tmp = 2 * i * c +    xx, yy = x - i, y - i +    tmp += max(0, xx) * a +    tmp += max(0, yy) * b +    res = min(res, tmp)