package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func next() string {
	sc.Scan()
	return sc.Text()
}
func nextInt() int {
	a, _ := strconv.Atoi(next())
	return a
}
func nextInts(n int) []int {
	ret := make([]int, n)
	for i := 0; i < n; i++ {
		ret[i] = nextInt()
	}
	return ret
}
func nextInt64() int64 {
	a, _ := strconv.ParseInt(next(), 10, 64)
	return a
}

//var done []bool = make([]bool, 10)
//var memo []int = make([]int, 10)

//func fib(n int) int {
//	fmt.Println(n)
//	if n == 0 {
//		return 0
//	}
//	if n == 1 {
//		return 1
//	}
//	if done[n] {
//		fmt.Println("done" + fmt.Sprint(n))
//		return memo[n]
//	}
//	done[n] = true
//	memo[n] = fib(n-1) + fib(n-2)
//	return memo[n]
//}

var m map[string]int = make(map[string]int)
var mInt map[int]int = make(map[int]int)

//var dp []int = make([]int, n)

//func fib(n int) int {
//	dp[0] = 0
//	dp[1] = 1
//	for i := 2; i <= n; i++ {
//		dp[i] = dp[i-1] + dp[i-2]
//	}
//	return dp[n]
//}

func line(ii []int, bn []int) []int {
	var res []int = ii
	for i := 0; i < len(ii); i++ {
		for j := 0; j < len(bn); j++ {
			if ii[i] == bn[j] {
				fmt.Println("hit" + fmt.Sprint(ii[i]))
				if i == len(ii)-1 {
					res = ii[:i]
				} else {
					res = append(ii[:i], ii[i+1:]...)
				}
			}
		}
	}
	return res
}

func main() {
	sc.Split(bufio.ScanWords)
	defer out.Flush() // !!!!coution!!!! you must use Fprint(out, ) not Print()
	a := nextInt()
	b := nextInt()
	c := nextInt()
	x := nextInt()
	y := nextInt()

	countX := 0.0
	countY := 0.0
	result := 0
	cLoop := x
	if cLoop < y {
		cLoop = y
	}
	for i := 0; i < cLoop*2; i++ {
		countX += 0.5 * float64(i+1)
		countY += 0.5 * float64(i+1)
		money := c * (i + 1)
		for j := 0; j < x; j++ {
			if int(countX) >= x {
				break
			}
			countX += 1
			money += a
		}
		for k := 0; k < y; k++ {
			if int(countY) >= y {
				break
			}
			countY += 1
			money += b
		}
		if result <= 0 {
			result = money
		} else if result > money {
			result = money
		}
		countX = 0.0
		countY = 0.0
	}

	fmt.Fprint(out, result)
}
