A, B, AB, X, Y = map(int, input().split())
max_price = A * X + B * Y
flag = 1
mid_price = (A + B) // 2
if A > AB and B > AB:
    min_sheet = max(X, Y)
else:
    min_sheet = min(X, Y)

price = max_price + 1

while flag:
    flag = 0
    if AB < mid_price:
        price = min_sheet * AB * 2
        X -= min_sheet
        Y -= min_sheet
    if X < 1 and Y < 1:
        break
    elif X > 0:
        price += X * A
        if Y > 0:
            price += Y * B
    elif Y > 0:
        price += Y * B
        if X > 0:
            price += X * A

print(min(max_price, price))
