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

x = x*2
y = y*2

if c < (a+b)/2:
    while min(x,y) > 0:
        ans += c
        x -= 1
        y -= 1

if c <= a/2 or c <= b/2:
    while max(x,y) > 0:
        ans += c
        x -= 1
        y -= 1

if a <= c or x > 0:
    while x > 0:
        ans += a
        x -= 2

if b <= c or y > 0:
    while y > 0:
        ans += b
        y -= 2

print(ans)
