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



ans=10**10

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

    cnt=0

    cnt+=C*2*i

    x=X-i

    y=Y-i

    cnt+=max(0,x*A)

    cnt+=max(0,y*B)

    if ans>cnt:

        ans=cnt

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



ans=10**12

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

    cnt=0

    cnt+=i*C*2

    cnt+=max(0,X-i)*A

    cnt+=max(0,Y-i)*B

    ans=min(ans,cnt)

print(ans)
A, B, C, X, Y = list(map(int, input().split()))
ans = 10**10
for i in range(max(X, Y) + 1):
    cnt = 0
    cnt += C * 2 * i
    x = X - i
    y = Y - i
    cnt += max(0, x * A)
    cnt += max(0, y * B)
    if ans > cnt:
        ans = cnt
print(ans)

A, B, C, X, Y = list(map(int, input().split()))
ans = 10**12
for i in range(max(X, Y) + 1):
    cnt = 0
    cnt += i * C * 2
    cnt += max(0, X - i) * A
    cnt += max(0, Y - i) * B
    ans = min(ans, cnt)
print(ans)

-ans = 10**10 +ans = 10**12 -    cnt += C * 2 * i -    x = X - i -    y = Y - i -    cnt += max(0, x * A) -    cnt += max(0, y * B) -    if ans > cnt: -        ans = cnt +    cnt += i * C * 2 +    cnt += max(0, X - i) * A +    cnt += max(0, Y - i) * B +    ans = min(ans, cnt)