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

xy = max(x,y)*2+1

print((min([c*i + max(0,a*(x-i//2)) +max(0,b*(y-i//2)) for i in range(0,xy,2)])))
a,b,c,x,y = list(map(int,input().split()))

if x < y:

    a, b, x, y = b, a, y, x

print((min(a*x+b*y,2*c*y + a*(x-y),2*c*x)))
a, b, c, x, y = list(map(int, input().split()))
xy = max(x, y) * 2 + 1
print(
    (
        min(
            [
                c * i + max(0, a * (x - i // 2)) + max(0, b * (y - i // 2))
                for i in range(0, xy, 2)
            ]
        )
    )
)

a, b, c, x, y = list(map(int, input().split()))
if x < y:
    a, b, x, y = b, a, y, x
print((min(a * x + b * y, 2 * c * y + a * (x - y), 2 * c * x)))

-xy = max(x, y) * 2 + 1 -print( -    ( -        min( -            [ -                c * i + max(0, a * (x - i // 2)) + max(0, b * (y - i // 2)) -                for i in range(0, xy, 2) -            ] -        ) -    ) -) +if x < y: +    a, b, x, y = b, a, y, x +print((min(a * x + b * y, 2 * c * y + a * (x - y), 2 * c * x)))