S = input().split(" ")

A = int(S[0])
B = int(S[1])
C = int(S[2])
X = int(S[3])
Y = int(S[4])



def calculate(a,b,c,x,y):
    s1 = a * x + b * y

    base = min([x,y])

    if base % 2 == 1:
        base = base - 1


    values = [s1]
    for i in range(base):
        index = (i + 1)
        tmp = s1 - (A + B) * index + 2 * C * index
        values.append(tmp)



    print(min(values))


calculate(A,B,C,X,Y)