piza_a, piza_b, piza_ab, a_need, b_need = gets.split(" ").map(&:to_i)
#piza_ab2枚でabそれぞれ一枚
piza_ab = piza_ab*2
a_ans = 0
b_ans = 0
ans = 0
if piza_ab < piza_a && piza_ab < piza_b then
  ans = piza_ab * (a_need < b_need ? b_need : a_need)
elsif piza_ab <= piza_a + piza_b then
  if a_need < b_need then
    same_need = a_need
    b_need -= a_need
  else
    same_need = b_need
    a_need -= b_need
  end
  ans = piza_ab * (same_need)
  ans += piza_a * a_need + piza_b * b_need

else
  ans += piza_a * a_need
  ans += piza_b * b_need
end
p ans