


a,b,c,x,y = map(int,input().split())

price = a * x + b * y


for i in range(1, max(a,b) + 1):
    ab = 2 * i
    cand = ab * c + a * max(0, x - i) + b * max(0, y-i)

    price = min(price, cand)

print(price)
  
