A, B, C, X, Y = map(int, input().split())
def price(num_c):
    x, y = max(0, X-num_c//2), max(0, Y-num_c//2)
    return x*A + y*B + num_c * C

lo = 0
hi = max(X, Y) * 2-1
ans = min(price(lo), price(hi+1))
while hi - lo > 1:
    mid = (hi+lo)//2
    result1 = price(mid)
    result2 = price(mid+1)
    ans = min(ans, result1, result2)
    if result1 - result2 > 0:
        lo = mid
    elif result1 - result2 < 0:
        hi = mid
    else:
        print(ans)
        exit()

print(ans)