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



if a+b <= 2*c:

        print((a*x + b*y))

elif a+b > 2*c:

        if x == y:

                print((c * 2*x))

        elif x < y:

                print((min(c*2*x + b*(y-x), c*2*y)))

        else:

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



if a+b < 2*c:

    ans = a*x + b*y

else:

    if x < y:

        ans = 2*c * x + b*(y-x)

    elif y < x:

        ans = 2*c * y + a*(x-y)

    else:

        ans = 2*c*x

    ans = min(ans, 2*c*max(x,y))



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

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

-if a + b <= 2 * c: -    print((a * x + b * y)) -elif a + b > 2 * c: -    if x == y: -        print((c * 2 * x)) -    elif x < y: -        print((min(c * 2 * x + b * (y - x), c * 2 * y))) +if a + b < 2 * c: +    ans = a * x + b * y +else: +    if x < y: +        ans = 2 * c * x + b * (y - x) +    elif y < x: +        ans = 2 * c * y + a * (x - y) -        print((min(c * 2 * y + a * (x - y), c * 2 * x))) +        ans = 2 * c * x +    ans = min(ans, 2 * c * max(x, y)) +print(ans)