a,b,c,x,y=list(map(int,input().split()));print((min(k*c*2+a*max(x-k,0)+b*max(y-k,0)for k in range(max(x,y)*3))))
a,b,c,x,y=list(map(int,input().split()));print((min(x*a+y*b,2*x*c+b*max(0,y-x),2*y*c+a*max(0,x-y))))
a, b, c, x, y = list(map(int, input().split()))
print(
    (
        min(
            k * c * 2 + a * max(x - k, 0) + b * max(y - k, 0)
            for k in range(max(x, y) * 3)
        )
    )
)

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

-    ( -        min( -            k * c * 2 + a * max(x - k, 0) + b * max(y - k, 0) -            for k in range(max(x, y) * 3) -        ) -    ) +    (min(x * a + y * b, 2 * x * c + b * max(0, y - x), 2 * y * c + a * max(0, x - y)))