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

#一時的な値段
tmp = A * X + B * Y

#1単位ずつCに変えていって減るかを検証
counter = 0
XY_max = max(X,Y)
XY_min = min(X,Y)

for i in range(XY_max):
    if i <= XY_min-1:
        minprice = tmp - A - B + 2 * C
    else:
        minprice = tmp - max(A,B) + 2 * C
    tmp = min(tmp,minprice)

print(tmp)