a, b, c, x, y = [int(i) for i in input().split()]

ans = 10**18

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

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

print(ans)

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

ans = 10 ** 18

for i in range(10 ** 5 * 2):

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

print(ans)

a, b, c, x, y = [int(i) for i in input().split()]
ans = 10**18
for i in range(max(x, y) * 2 + 1):
    ans = min(ans, c * i + max(0, (x - i // 2)) * a + max(0, (y - i // 2)) * b)
print(ans)

a, b, c, x, y = list(map(int, input().split()))
ans = 10**18
for i in range(10**5 * 2):
    ans = min(ans, i * 2 * c + max(0, x - i) * a + max(0, y - i) * b)
print(ans)

-a, b, c, x, y = [int(i) for i in input().split()] +a, b, c, x, y = list(map(int, input().split())) -for i in range(max(x, y) * 2 + 1): -    ans = min(ans, c * i + max(0, (x - i // 2)) * a + max(0, (y - i // 2)) * b) +for i in range(10**5 * 2): +    ans = min(ans, i * 2 * c + max(0, x - i) * a + max(0, y - i) * b)