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

a_num = 0
b_num = 0
c_num = 2 * max(x,y)+1
total = 5000 * 10 ** 5 * 2


for i in range(0,x+1):
    for j in range(0,y+1):
        k = 2 * max(x-i,y-j)
        if not(a_num == i and c_num == k):
            if not(b_num == j and c_num ==k):
                a_num = i
                b_num = j
                c_num = k
                target = a * i + b * j + c * k
                if total > target:
                    total = target
                else:
                    break
            else:
                break
        else:
            break
print(total)