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

ans = float('inf')

if A + B >= 2 * C:
    p = (2 * max(X, Y)) * C
    ans = min(ans, p)
else:
    for x in range(X + 1):
        for y in range(Y + 1):
            c = max(X - x, Y - y)
            p = x * A + y * B + (2 * c) * C
            ans = min(ans, p)

print(ans)