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

ans = float('inf')



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

    tmp = i*2*c + max(0, x-i)*a + max(0, y-i)*b

    if ans > tmp:

        ans = tmp

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

ans = float('inf')



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

    tmp = i*2*c

    if i>=x:

        pass

    else:

        tmp += (x-i)*a

    if i>=y:

        pass

    else:

        tmp += (y-i)*b

    if ans > tmp:

        ans = tmp



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

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

-    tmp = i * 2 * c + max(0, x - i) * a + max(0, y - i) * b +    tmp = i * 2 * c +    if i >= x: +        pass +    else: +        tmp += (x - i) * a +    if i >= y: +        pass +    else: +        tmp += (y - i) * b