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

p = a*(x-min(x,y)) if x > y else b*(y-min(x,y))



print((min((a+b)*min(x,y)+p,c*min(x,y)*2+p,c*max(x,y)*2)))
a,b,c,x,y = list(map(int,input().split()))

if x >= y:

    print((min(c*2*y+a*(x-y), a*x+b*y, c*2*x)))

else:

    print((min(c*2*x+b*(y-x),a*x+b*y, c*2*y)))



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

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

-p = a * (x - min(x, y)) if x > y else b * (y - min(x, y)) -print((min((a + b) * min(x, y) + p, c * min(x, y) * 2 + p, c * max(x, y) * 2))) +if x >= y: +    print((min(c * 2 * y + a * (x - y), a * x + b * y, c * 2 * x))) +else: +    print((min(c * 2 * x + b * (y - x), a * x + b * y, c * 2 * y)))