def min(a, b)
  return (a < b) ? a : b
end

def abs(a)
  return a.abs
end

def which_buy(x, a, y, b)
  if x < y
    return b
  else
    return a
  end
end

def how_pizza_buy(a, b, c, x, y)
  if a+b < c*2 then
    puts "a+b < c*2"
    return a*x+b*y 
  else
    puts "else"
    puts "min: " + min(x,y).to_s
    puts "which buy: " + which_buy(x,a,y,b).to_s
    puts "C pizza price: " + (min(x,y)*c*2).to_s
    puts "Another pizza price: " + (abs(x-y)*which_buy(x,a,y,b)).to_s
    return min(x,y)*2*c+abs(x-y)*which_buy(x, a, y, b)
  end
end

a, b, c, x, y = gets.chomp.split.map(&:to_i)
puts how_pizza_buy(a, b, c, x, y)
