a, b, c, x, y = map(int, input().split())
ans = 0
c *= 2

if x > y:
    if c < a and c < b:
        ans = c*x
    elif c < a and c > b:
        ans = b*y + c*(x-y)
    elif c > a and c < b:
        ans = c*y + a*(x-y)
    elif c < a+b:
        ans = c*y + a*(x-y)
    else:
        ans = a*x + b*y
else:
    if c < a and c < b:
        ans = c*y
    elif c < a and c > b:
        ans = c*x + b*(y-x)
    elif c > a and c < b:
        ans = a*x + c*(y-x)
    elif c < a+b:
        ans = c*x + b*(y-x)
    else:
        ans = a*x + b*y

print(ans)