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

ab = min(a+b, c*2)

if x>y:

    tmp, tmp2, tmp3 = y, (x-y)*a, (x-y)*ab

else:

    tmp, tmp2, tmp3 = x, (y-x)*b, (y-x)*ab

ans = 0

for i in range(tmp):

    ans += ab

print((ans+min(tmp2, tmp3)))

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

ab = c*2

if a+b > ab:

    t = ab*min(x,y)

    d = max(x,y)-min(x,y)

    if x>y: dd = a*d

    else: dd = b*d

    print((t+ab*d if dd>ab*d else t+dd))

else:

    print((a*x+b*y))
a, b, c, x, y = list(map(int, input().split()))
ab = min(a + b, c * 2)
if x > y:
    tmp, tmp2, tmp3 = y, (x - y) * a, (x - y) * ab
else:
    tmp, tmp2, tmp3 = x, (y - x) * b, (y - x) * ab
ans = 0
for i in range(tmp):
    ans += ab
print((ans + min(tmp2, tmp3)))

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

-ab = min(a + b, c * 2) -if x > y: -    tmp, tmp2, tmp3 = y, (x - y) * a, (x - y) * ab +ab = c * 2 +if a + b > ab: +    t = ab * min(x, y) +    d = max(x, y) - min(x, y) +    if x > y: +        dd = a * d +    else: +        dd = b * d +    print((t + ab * d if dd > ab * d else t + dd)) -    tmp, tmp2, tmp3 = x, (y - x) * b, (y - x) * ab -ans = 0 -for i in range(tmp): -    ans += ab -print((ans + min(tmp2, tmp3))) +    print((a * x + b * y))