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

mincost = 10000000000

for a in range(X + 1):
    for b in range(Y + 1):
        c = max([(X - a) * 2, (Y - b) * 2])
        cost = a * A + b * B + c * C
        if (cost < mincost):
            mincost = cost

print(mincost)