inf = (5000 * 10 ** 5) * 3



a, b, c, x, y = list(map(int, input().split()))



ret = inf

for cnt_ab in range(max(x, y) * 2 + 1):

    d = cnt_ab // 2



    cnt_a = max(0, x - d)

    cnt_b = max(0, y - d)



    t = cnt_ab * c + cnt_a * a + cnt_b * b

    ret = min(ret, t)

print(ret)

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()

inf = (5000 * 10**5) * 3
a, b, c, x, y = list(map(int, input().split()))
ret = inf
for cnt_ab in range(max(x, y) * 2 + 1):
    d = cnt_ab // 2
    cnt_a = max(0, x - d)
    cnt_b = max(0, y - d)
    t = cnt_ab * c + cnt_a * a + cnt_b * b
    ret = min(ret, t)
print(ret)

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()

-inf = (5000 * 10**5) * 3 -a, b, c, x, y = list(map(int, input().split())) -ret = inf -for cnt_ab in range(max(x, y) * 2 + 1): -    d = cnt_ab // 2 -    cnt_a = max(0, x - d) -    cnt_b = max(0, y - d) -    t = cnt_ab * c + cnt_a * a + cnt_b * b -    ret = min(ret, t) -print(ret) +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()