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

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

if X>Y:

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

else:

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

print(ans)

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

ans=a*x+b*y

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

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

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

-A, B, C, X, Y = list(map(int, input().split())) -ans = min(A + B, 2 * C) * min(X, Y) -if X > Y: -    ans += min(A, 2 * C) * (X - Y) -else: -    ans += min(B, 2 * C) * (Y - X) +a, b, c, x, y = list(map(int, input().split())) +ans = a * x + b * y +ans = min(ans, c * x * 2 + max(0, y - x) * b, c * y * 2 + max(0, x - y) * a)