A, B, C, X, Y = [int(_) for _ in input().split()]

ans = A * X + B * Y

for i in range(max(X, Y) + 1):

    cost = 2 * C * i

    if X > i:

        cost += A * (X - i)

    if Y > i:

        cost += B * (Y - i)

    ans = min(ans, cost)

print(ans)
A, B, C, X, Y = [int(_) for _ in input().split()]

M = max(X, Y)

print((min(2 * C * M, 2 * C * (X + Y - M) + A *

          (M - Y) + B * (M - X), A * X + B * Y)))

A, B, C, X, Y = [int(_) for _ in input().split()]
ans = A * X + B * Y
for i in range(max(X, Y) + 1):
    cost = 2 * C * i
    if X > i:
        cost += A * (X - i)
    if Y > i:
        cost += B * (Y - i)
    ans = min(ans, cost)
print(ans)

A, B, C, X, Y = [int(_) for _ in input().split()]
M = max(X, Y)
print((min(2 * C * M, 2 * C * (X + Y - M) + A * (M - Y) + B * (M - X), A * X + B * Y)))

-ans = A * X + B * Y -for i in range(max(X, Y) + 1): -    cost = 2 * C * i -    if X > i: -        cost += A * (X - i) -    if Y > i: -        cost += B * (Y - i) -    ans = min(ans, cost) -print(ans) +M = max(X, Y) +print((min(2 * C * M, 2 * C * (X + Y - M) + A * (M - Y) + B * (M - X), A * X + B * Y)))