A, B, C, X, Y = map(int,input().split())

def piz(a, b, cost):
    if a >= X and b >= Y:
        print(cost)
    
    if a < X and b >= Y:
        piz(a+1, b, cost+A)
    if a >= X and b < Y:
        piz(a, b+1, cost+B)
    if a < X and b < Y and A + B < C * 2:
        piz(a+1, b+1, cost+A+B)
    if a < X and b < Y and A + B >= C * 2:
        piz(a+1, b+1, cost+C*2)

piz(0, 0, 0)