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

price =[]

for a in range(X):
    for b in range(Y):
        for c in range(X + Y + 1):
            if X <= a + c // 2 and Y <= b + c // 2:
                price.append(A*a+B*b+C*c)

print(min(price))
