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



c = int(c*2)

m = float('inf')

for i in range(10**5+1):

    m = min(m, a*max(0, x-i)+b*max(0,y-i)+c*i)

print(m)
import math

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

ans = float('inf')

c = c*2

for i in range(max(x, y)+1):

    if i > x:

        price = b*(y-i) + c*i

    elif i > y:

        price = a*(x-i) + c*i

    else:

        price = a*(x-i) + b*(y-i) + c*i



    if ans > price:

        ans = price

print(ans)
a, b, c, x, y = list(map(int, input().split(" ")))
c = int(c * 2)
m = float("inf")
for i in range(10**5 + 1):
    m = min(m, a * max(0, x - i) + b * max(0, y - i) + c * i)
print(m)

import math

a, b, c, x, y = list(map(int, input().split(" ")))
ans = float("inf")
c = c * 2
for i in range(max(x, y) + 1):
    if i > x:
        price = b * (y - i) + c * i
    elif i > y:
        price = a * (x - i) + c * i
    else:
        price = a * (x - i) + b * (y - i) + c * i
    if ans > price:
        ans = price
print(ans)

+import math + -c = int(c * 2) -m = float("inf") -for i in range(10**5 + 1): -    m = min(m, a * max(0, x - i) + b * max(0, y - i) + c * i) -print(m) +ans = float("inf") +c = c * 2 +for i in range(max(x, y) + 1): +    if i > x: +        price = b * (y - i) + c * i +    elif i > y: +        price = a * (x - i) + c * i +    else: +        price = a * (x - i) + b * (y - i) + c * i +    if ans > price: +        ans = price +print(ans)