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

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

is_break = 0
for a in range(X+1):
    if is_break:
        break
    for b in range(Y+1):
        if is_break:
            break
        for c in [2 * max((X-a), (Y-b)), 2 * max(X-a, Y-b) + 1]:
            if price >= A*a+B*b+C*c:
                price = A*a+B*b+C*c
                is_break = 1
                break

print(price)
