def pizza_price_less_a(a, c)
 return true if a*2 < c*2
 return false
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 
  elsif pizza_price_less(a, c)
    puts "elsif pizza_price_less"
    return x*c*2+x*a
  elsif pizza_price_less(b, c)
    return y*c*2+y*b
  else
    puts "else"
    #return min(x,y)*2*c+abs(x-y)*which_buy(x, a, y, b)
    return [x,y].max*c*2
  end
end

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