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

price_min = float('inf')

for ib in range(Y+1):
    price_min_b = float('inf')
    for ia in range(X+1):
        ic = max(X-ia, Y-ib) * 2
        price = A*ia+B*ib+C*ic
        print(ia, ib, ic, price)
        if price < price_min_b:
            price_min_b = price
        elif price > price_min_b:
            break
    if price_min_b < price_min:
        price_min = price_min_b
    elif price_min_b > price_min:
        break

print(price_min)