A,B,C,X,Y = list(map(int,input().split()))

l = []

for i in range(max(X,Y)+1):

    T = i * C * 2

    if i < X: 

        T += (X-i)*A

    if i < Y:

        T += (Y-i)*B

    l.append(T)

l.sort()

print((l[0]))
A,B,C,X,Y = list(map(int,input().split()))

ans = 0

if 2*C <= A+B:

    Z = min(X,Y)

    ans = 2*C*Z

    X -= Z

    Y -= Z

ans += min(2*C*X,A*X)

ans += min(2*C*Y,B*Y)

print(ans)
A, B, C, X, Y = list(map(int, input().split()))
l = []
for i in range(max(X, Y) + 1):
    T = i * C * 2
    if i < X:
        T += (X - i) * A
    if i < Y:
        T += (Y - i) * B
    l.append(T)
l.sort()
print((l[0]))

A, B, C, X, Y = list(map(int, input().split()))
ans = 0
if 2 * C <= A + B:
    Z = min(X, Y)
    ans = 2 * C * Z
    X -= Z
    Y -= Z
ans += min(2 * C * X, A * X)
ans += min(2 * C * Y, B * Y)
print(ans)

-l = [] -for i in range(max(X, Y) + 1): -    T = i * C * 2 -    if i < X: -        T += (X - i) * A -    if i < Y: -        T += (Y - i) * B -    l.append(T) -l.sort() -print((l[0])) +ans = 0 +if 2 * C <= A + B: +    Z = min(X, Y) +    ans = 2 * C * Z +    X -= Z +    Y -= Z +ans += min(2 * C * X, A * X) +ans += min(2 * C * Y, B * Y) +print(ans)