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



if A + B < 2 * C:

    print((A * X + B * Y))

else:  # ABピザを二枚ずつ増やしていく。最大は2(max(x,y))

    ans = float('inf')

    for i in range(0, max(X, Y) * 2 + 1, 2):

        ans = min(ans, max(A * (X - i // 2), 0) + max(B * (Y - i // 2), 0) + C * i)

    print(ans)

def solve():

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

    ans = X*A + Y*B

    for i in range(max(X,Y)+1):

        aandb = A * max(0, X-i) + B * max(0, Y-i)

        ab = 2*C*i

        ans = min(ans, aandb + ab)

    print(ans)



if __name__ == '__main__':

    solve()
A, B, C, X, Y = list(map(int, input().split()))
if A + B < 2 * C:
    print((A * X + B * Y))
else:  # ABピザを二枚ずつ増やしていく。最大は2(max(x,y))
    ans = float("inf")
    for i in range(0, max(X, Y) * 2 + 1, 2):
        ans = min(ans, max(A * (X - i // 2), 0) + max(B * (Y - i // 2), 0) + C * i)
    print(ans)

def solve():
    A, B, C, X, Y = list(map(int, input().split()))
    ans = X * A + Y * B
    for i in range(max(X, Y) + 1):
        aandb = A * max(0, X - i) + B * max(0, Y - i)
        ab = 2 * C * i
        ans = min(ans, aandb + ab)
    print(ans)


if __name__ == "__main__":
    solve()

-A, B, C, X, Y = list(map(int, input().split())) -if A + B < 2 * C: -    print((A * X + B * Y)) -else:  # ABピザを二枚ずつ増やしていく。最大は2(max(x,y)) -    ans = float("inf") -    for i in range(0, max(X, Y) * 2 + 1, 2): -        ans = min(ans, max(A * (X - i // 2), 0) + max(B * (Y - i // 2), 0) + C * i) +def solve(): +    A, B, C, X, Y = list(map(int, input().split())) +    ans = X * A + Y * B +    for i in range(max(X, Y) + 1): +        aandb = A * max(0, X - i) + B * max(0, Y - i) +        ab = 2 * C * i +        ans = min(ans, aandb + ab) + + +if __name__ == "__main__": +    solve()