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

price = 5000 * 100000 * 2

for a in range(X+1):
    for b in range(Y+1):
        for c in range(min([2*(X-a), 2*(Y-b)]), X + Y + 1):
            if X <= a + c // 2 and Y <= b + c // 2:
                if price > A*a+B*b+C*c:
                    price = A*a+B*b+C*c

print(price)
