a,b,c,x,y=gets.split(" ").map(&:to_i)
min = 0
max = 0
if x > y
  min = y
  max = x
else
  min = x
  max = y
end

if a + b > 2*c && 2*c < min
  sum = 2*c*max
elsif a + b > 2*c && 2*c >= min
  sum = (2*c - a - b)*min + a*x + b*y
else
  sum = a*x + b*y
end


puts sum
