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 a_num == i and c_num == k:
            break
        else:
            a_num = i
            c_num = k
            target = a * i + b * j + c * k
            if total > target:
                total = target
            else:
                break
print(total)