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

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

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

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

-    (min(a * x + b * y, c * 2 * x + b * max(0, y - x), c * 2 * y + a * max(0, x - y))) +    ( +        min( +            a * x + b * y, +            a * max(x - y, 0) + b * max(y - x, 0) + c * 2 * min(x, y), +            c * 2 * max(x, y), +        ) +    )