a, b, c, x, y = map(int, input().split())
mini = 10000000000
if x < y: temp = x
else: temp = y
for i in range(0, temp * 2 + 1, 2):
    # print(x - i/2, y - i/2, i)
    price = a * (x - int(i/2)) + b * (y - int(i/2)) + c * i
    if price < mini:
        mini = price
print(mini)