package main

import(
	"fmt"
	"math"
)

func main() {

	var a, b, c, x, y int
	fmt.Scan(&a, &b, &c, &x, &y)
	ans := math.MaxInt64
	c = 2*c

	for i := 0; i <= 100000; i++ {
		if i*2*c + int(math.Max(0.0, float64(x - i)))*a + int(math.Max(0.0, float64(y - i)))*b < ans {
			ans = i*2*c + int(math.Max(0.0, float64(x - i)))*a + int(math.Max(0.0, float64(y - i)))*b
		}
	}
	fmt.Println(ans)
}