a,b,c,x,y = gets.split.map &:to_i
 
if [a,b,c].max == c
    puts a * x + b * y
    return
end
 
max = 500000000
(0..(2*[x,y].max)).each do |i|
    pay = i * c + (x - (i / 2)) * a + (y - (i / 2)) * b
    max = pay if pay < max
end
puts max