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

min_price = A * X + B * Y

if A + B > 2 * C:
    if X > 0 and Y > 0:
        min_price -= (A + B - 2 * C) * min(X, Y)
        if X > Y:
            X = X - Y
            Y = 0
        if Y > X:
            X = 0
            Y = Y - X

if X > 0 and A > 2 * C:
    min_price -= (A - 2 * C) * X

if Y > 0 and B > 2 * C:
    min_price -= (B - 2 * C) * Y

print(min_price)
