def main():

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

    M = max(X, Y)



    k = 0

    ans = A * X + B * Y

    while True:

        ans = min(

            ans,

            AB * k * 2 + max(0, X - k) * A + max(0, Y - k) * B

        )



        if k >= M: break

        k += 1



    print(ans)





if __name__ == '__main__':

    main()

def main():

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



    ans = 1 << 30

    c = 0  # even

    while True:

        j = c // 2

        t = A * max(0, X - j) + B * max(0, Y - j) + C * c

        if ans <= t: break

        ans = t

        c += 2



    print(ans)





if __name__ == '__main__':

    main()

def main():
    A, B, AB, X, Y = list(map(int, input().split()))
    M = max(X, Y)
    k = 0
    ans = A * X + B * Y
    while True:
        ans = min(ans, AB * k * 2 + max(0, X - k) * A + max(0, Y - k) * B)
        if k >= M:
            break
        k += 1
    print(ans)


if __name__ == "__main__":
    main()

def main():
    A, B, C, X, Y = list(map(int, input().split()))
    ans = 1 << 30
    c = 0  # even
    while True:
        j = c // 2
        t = A * max(0, X - j) + B * max(0, Y - j) + C * c
        if ans <= t:
            break
        ans = t
        c += 2
    print(ans)


if __name__ == "__main__":
    main()

-    A, B, AB, X, Y = list(map(int, input().split())) -    M = max(X, Y) -    k = 0 -    ans = A * X + B * Y +    A, B, C, X, Y = list(map(int, input().split())) +    ans = 1 << 30 +    c = 0  # even -        ans = min(ans, AB * k * 2 + max(0, X - k) * A + max(0, Y - k) * B) -        if k >= M: +        j = c // 2 +        t = A * max(0, X - j) + B * max(0, Y - j) + C * c +        if ans <= t: -        k += 1 +        ans = t +        c += 2