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

ans = a*x + b*y

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

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

	if money <= ans:

		ans = money

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

if a + b >= 2*c:

	if x >= y:

		ans = 2*y*c + (x-y)*min(a,2*c)

	else:

		ans = 2*x*c + (y-x)*min(b,2*c)

else:

	ans = (x*a + y*b)

print(ans)
a, b, c, x, y = list(map(int, input().split()))
ans = a * x + b * y
for i in range(max(x, y) + 1):
    money = max(0, (x - i) * a) + max(0, (y - i) * b) + 2 * i * c
    if money <= ans:
        ans = money
print(ans)

a, b, c, x, y = list(map(int, input().split()))
if a + b >= 2 * c:
    if x >= y:
        ans = 2 * y * c + (x - y) * min(a, 2 * c)
    else:
        ans = 2 * x * c + (y - x) * min(b, 2 * c)
else:
    ans = x * a + y * b
print(ans)

-ans = a * x + b * y -for i in range(max(x, y) + 1): -    money = max(0, (x - i) * a) + max(0, (y - i) * b) + 2 * i * c -    if money <= ans: -        ans = money +if a + b >= 2 * c: +    if x >= y: +        ans = 2 * y * c + (x - y) * min(a, 2 * c) +    else: +        ans = 2 * x * c + (y - x) * min(b, 2 * c) +else: +    ans = x * a + y * b