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

max_XY = max(X, Y)
min_XY = min(X, Y)
ans = float("inf")
for a in range(0, max_XY+1):
    ab = (max_XY - a) * 2
    if min_XY - ab / 2 > 0:
        b = int(min_XY - ab / 2)
    else:
        b = 0
    money = a * A + b * B + ab * C
    ans = min(ans, money)
print(ans)
