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

ans = 0



if a+b <= c*2:

    ans += min(x, y)*(a+b)

else:

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



if x > y:

    if a <= c*2:

        ans += (x-y)*a

    else:

        ans += (x-y)*c*2

else:

    if b <= c*2:

        ans += (y-x)*b

    else:

        ans += (y-x)*c*2



print(ans)

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

INF = float("inf")

ans = INF

for ab in range(max(x, y)*2+1):

    if ab % 2 == 0:

        ans = min(ans, ab*c + max(x-ab//2, 0)*a + max(y-ab//2, 0)*b)

print(ans)

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

a, b, c, x, y = list(map(int, input().split()))
INF = float("inf")
ans = INF
for ab in range(max(x, y) * 2 + 1):
    if ab % 2 == 0:
        ans = min(ans, ab * c + max(x - ab // 2, 0) * a + max(y - ab // 2, 0) * b)
print(ans)

-ans = 0 -if a + b <= c * 2: -    ans += min(x, y) * (a + b) -else: -    ans += min(x, y) * c * 2 -if x > y: -    if a <= c * 2: -        ans += (x - y) * a -    else: -        ans += (x - y) * c * 2 -else: -    if b <= c * 2: -        ans += (y - x) * b -    else: -        ans += (y - x) * c * 2 +INF = float("inf") +ans = INF +for ab in range(max(x, y) * 2 + 1): +    if ab % 2 == 0: +        ans = min(ans, ab * c + max(x - ab // 2, 0) * a + max(y - ab // 2, 0) * b)