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

for i in range(0, max(2 * x + 1, 2 * y + 1), 2):
    if x >= y and i <= 2 * y:
        if price > a * (x - i / 2) + b * (y - i / 2) + c * i :
            price = int(a * (x - i / 2) + b * (y - i / 2) + c * i)
    if x >= y and 2*y <= i:
        if price > a * (x - i / 2) + c * i :
            price = int(a * (x - i / 2) + c * i)
    if x < y and i <= 2 * x:
        if price > a * (x - i / 2) + b * (y - i / 2) + c * i :
            price = int(a * (x - i / 2) + b * (y - i / 2) + c * i)
    if x < y and 2*x <= i:
        if price > a * (y - i / 2) + c * i :
            price = int(a * (y - i / 2) + c * i)

print(price)