class Problem
  getter a : Int64
  getter b : Int64
  getter c : Int64
  getter x : Int64
  getter y : Int64

  def initialize
    @a,@b,@c,@x,@y = gets.to_s.split.map { |v| v.to_i64 }
  end

  def cost(i,j,k)
    i = [i,0].max
    j = [j,0].max
    i * a + j * b + k * c
  end

  def solve
    ans = 10_i64 ** 12
    1_i64.upto([x,y].max*2) do |k|
      cnt = cost(x - k // 2, y - k // 2, k)
      ans = cnt if cnt < ans
    end
    ans
  end

  def show(ans)
    puts ans
  end

  def instance_eval
    with self yield
  end
end

Problem.new.instance_eval do
  show(solve)
end

