import sys
input = sys.stdin.readline

a, b, c, x, y = map(int, input().split())
c *= 2
f = [0]*2
g = 0
if a+b < c:
    ans = a*x + b*y
else:
    ans = min(x, y)*c
    if x > y:
        f[0] = x
        f[1] = a
        g = y
    elif y > x:
        f[0] = y
        f[1] = b
        g = x
    check = ans+(f[0]-g)*f[1]
    ans = f[0]*c
    if ans > check:
        ans = check
print(ans)