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

if 2 * c < min(a, b):
    ans = 2 * c * max(x, y)
elif 2 * c >= max(a, b):
    ans = a * x + b * y
else:
    ans_1 = 2 * c * min(x, y)
    if a <= 2 * c < b and x < y:
        ans_2 = 2 * c * (y - min(x, y))
        ans = ans_1 + ans_2
    elif b <= 2 * c < a and x > y:
        ans_2 = 2 * c * (x - min(x, y))
        ans = ans_1 + ans_2
    elif x > y:
        ans_2 = (x - min(x, y)) * a
        ans = ans_1 + ans_2
    elif y > x:
        ans_2 = (y - min(x, y)) * b
        ans = ans_2 + ans_1

print(ans)
