a,b,c,x,y=[int(i) for i in input().split()]



sum_list=[]





max_c=max(x,y)



#ABセットをi組頼む

for i in range(max_c+1):

    

    #Cのみ

    if i>=x and i>=y:

        sum=2*c*i

        

    #CとA

    elif i<x and i>=y:

        sum=2*c*i+a*(x-i)

    

    #CとB   

    elif i>=x and i<y:

        sum=2*c*i+b*(y-i)

    

    #CとAとB

    else:

        sum=2*c*i+a*(x-i)+b*(y-i)

        

    sum_list.append(sum)

    

    

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



#cのセット数の最大値

cmax=max(x,y)



t_list=[]



#cを何セット買うか

for i in range(cmax+1):

    if x>=i and y>=i:

        total=c*2*i+a*(x-i)+b*(y-i)

        

    elif x>=i and y<i:

        total=c*2*i+a*(x-i)

        

    else:

        total=c*2*i+b*(y-i)

        

    t_list.append(total)

    

print((min(t_list)))
a, b, c, x, y = [int(i) for i in input().split()]
sum_list = []
max_c = max(x, y)
# ABセットをi組頼む
for i in range(max_c + 1):
    # Cのみ
    if i >= x and i >= y:
        sum = 2 * c * i
    # CとA
    elif i < x and i >= y:
        sum = 2 * c * i + a * (x - i)
    # CとB
    elif i >= x and i < y:
        sum = 2 * c * i + b * (y - i)
    # CとAとB
    else:
        sum = 2 * c * i + a * (x - i) + b * (y - i)
    sum_list.append(sum)
print((min(sum_list)))

a, b, c, x, y = list(map(int, input().split()))
# cのセット数の最大値
cmax = max(x, y)
t_list = []
# cを何セット買うか
for i in range(cmax + 1):
    if x >= i and y >= i:
        total = c * 2 * i + a * (x - i) + b * (y - i)
    elif x >= i and y < i:
        total = c * 2 * i + a * (x - i)
    else:
        total = c * 2 * i + b * (y - i)
    t_list.append(total)
print((min(t_list)))

-a, b, c, x, y = [int(i) for i in input().split()] -sum_list = [] -max_c = max(x, y) -# ABセットをi組頼む -for i in range(max_c + 1): -    # Cのみ -    if i >= x and i >= y: -        sum = 2 * c * i -    # CとA -    elif i < x and i >= y: -        sum = 2 * c * i + a * (x - i) -    # CとB -    elif i >= x and i < y: -        sum = 2 * c * i + b * (y - i) -    # CとAとB +a, b, c, x, y = list(map(int, input().split())) +# cのセット数の最大値 +cmax = max(x, y) +t_list = [] +# cを何セット買うか +for i in range(cmax + 1): +    if x >= i and y >= i: +        total = c * 2 * i + a * (x - i) + b * (y - i) +    elif x >= i and y < i: +        total = c * 2 * i + a * (x - i) -        sum = 2 * c * i + a * (x - i) + b * (y - i) -    sum_list.append(sum) -print((min(sum_list))) +        total = c * 2 * i + b * (y - i) +    t_list.append(total) +print((min(t_list)))