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



K=10**9

for i in range(10**5+1):

    S=i*2*C+max(0,X-i)*A+max(0,Y-i)*B

    K=min(K,S)

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



a=min(X,Y)*min(A+B,2*C)



a+=max(0,X-Y)*min(A,2*C)

a+=max(0,Y-X)*min(B,2*C)





print(a)
A, B, C, X, Y = list(map(int, input().split()))
K = 10**9
for i in range(10**5 + 1):
    S = i * 2 * C + max(0, X - i) * A + max(0, Y - i) * B
    K = min(K, S)
print(K)

A, B, C, X, Y = list(map(int, input().split()))
a = min(X, Y) * min(A + B, 2 * C)
a += max(0, X - Y) * min(A, 2 * C)
a += max(0, Y - X) * min(B, 2 * C)
print(a)

-K = 10**9 -for i in range(10**5 + 1): -    S = i * 2 * C + max(0, X - i) * A + max(0, Y - i) * B -    K = min(K, S) -print(K) +a = min(X, Y) * min(A + B, 2 * C) +a += max(0, X - Y) * min(A, 2 * C) +a += max(0, Y - X) * min(B, 2 * C) +print(a)